Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More PHP tests? #453

Open
martin-braun opened this issue Feb 24, 2023 · 2 comments
Open

More PHP tests? #453

martin-braun opened this issue Feb 24, 2023 · 2 comments

Comments

@martin-braun
Copy link

martin-braun commented Feb 24, 2023

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!

@martin-braun martin-braun changed the title More PHP tests More PHP tests? Feb 24, 2023
@nuald
Copy link
Collaborator

nuald commented Feb 24, 2023

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).

@martin-braun
Copy link
Author

martin-braun commented Feb 24, 2023

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants