Skip to content

More PHP tests? #453

Open
Open

Description

@martin-braun

I found this project, because I want to compare Debian vs Alpine Linux to learn when to use what OS. I would love to have more PHP tests available, i.e. for matmul or primes.

Thank you!

Activity

  1. changed the title [-]More PHP tests[/-] [+]More PHP tests?[/+] on Feb 24, 2023
  2. nuald commented on Feb 24, 2023

    @nuald
    Collaborator

    We don't have any immediate plans to add more PHP tests, but all contributions are welcomed. Please let me note though that the general comparison should be not Debian vs Alpine, but rather glibc vs musl libc. Working extensively with both of them, I'd like to share my observations:

    • usually glibc is dynamically linked, and musl is statically, so the startup time of musl-based binaries is a little bit slower as the binaries are bigger;
    • musl had performance issues with the memory allocations, but malloc-ng (included since 1.2.1) pretty much fixed it. Another approach is using the custom allocator like jemalloc
    • musl is not that rich like glibc and has some API not implemented, or have caveats (like gethostbyname)

    From my PoV, the biggest advantage of musl is providing ability to build fully statically linked executables that is handy for the embedded or easy-to-deploy development. And, unfortunately, benchmarks could barely help here (or you need the specific benchmarks, like testing memory operations speed).

  3. martin-braun commented on Feb 24, 2023

    @martin-braun
    Author

    Hello @nuald, first of all thanks for the quick response. Yes this is all about glibc vs musl libc, not Debian vs. Alpine, and I very much appreciate your shared insights.

    Yes, comparison between binaries can show how much musl can improve the performance, but I'm interested how poor musl will perform when it comes to interpreted code. Afaik compilation with musl is slower and there are rumors that PHP performs worse since version 8, since they improved the JIT module. I'm not sure this had to do with memory allocations or whatever, my simple goal is to benchmark a lot of stuff to get a broader picture.

    Unfortunately, most PHP scripts require to hook-up a web server. While this is good to test real life scenarios, I want to get pure PHP metrics, instead.

    I'm interested in musl, not just because of usage in embedded systems, but also for use on lightweight linux containers. This is also why I don't run the docker container, instead, I hooked up an LXC container and installed all required dependencies via APK.

    So long story short, I'd like to test interpreters with various languages and code samples with glibc and musl to get a good overall picture about what musl can do well and what musl cannot do well.

    For instance, the python base64 test has shown that the encoding took slightly less time on musl, while the decoding took twice as much time on musl, which was interesting and revealing to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions