-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
When does Zephir Shine? Only 10% Performance Gain? #2119
Comments
Hi, I discovered this project just a few days ago and I thought it was a great idea and could benefit with performance. But just learned the project is officially abandoned... Besides, your tests show it actually does not improves performance too much... You tested on PHP 7.2 while on the latest 7.4 it should be even faster. Are you using Opcache or Preload in the test? |
I didn't realize it was abandoned (https://www.reddit.com/r/PHP/comments/iogji4/zephir_will_not_be_maintained_any_longer_and_will/), thank you for letting me know. I wasn't using Opcache or Preload. I know I can upgrade the PHP for additional performance, part of why I was building this into modules was to be able to whitelabel my application while maintaining some control over it through compiled obfuscation, the other was performance. Looking into other options. Other options seem to be to build it in Rust and then use PHP FFI, or build a standalone API application server to handle those transformations for me. While I do a fair amount of .NET C# work, I haven't done much with C or C++ and feel that Rust may be more beneficial to learn if I have to learn something new. I realize PHP has a .NET option, but only if you run on a Windows server, which I will not likely ever do. |
I completely understand that we live in era of fake news, but on original news was written, quote:
and more important, quoute:
@ajhalls |
I am looking to optimize my web API which receives a steady stream of medical data from hundreds of offices. As a proof of concept, I rewrote a portion of the API in Zephir to build the
Patient
object.The Zephir Code:
Our old way was:
I had stripped out a couple keys in the beginning of the test such as
'communication_id' => $user->office->communication_id
which wasn't part of the incoming data just to be simpler. So the Zephir one was doing about 3 less keys than the raw PHP per cycle.To test, I used the following:
The average times were:
~0.068428039550781 Seconds - Zephir
~0.076008081436157 Seconds - PHP
I have run the test a number of times and it seems Zephir gives me about a 10% boost, is that expected? Is there something more I should be doing to get better performance gains? Seems like I could almost get that just optimizing what I have a little more.
The tasks I was looking to move over would be string manipulations such as the PhoneOrNull, and those hit most often by the APIs. I am looking to optimize which processes are handling data to minimize calls to the database, so I would be passing in 2 objects, cross comparing values, and only sending updates to the database when records actually change.
Running on Ubuntu 18.04, PHP 7.2, Zephir 0.12.19
The text was updated successfully, but these errors were encountered: