![]() Now we go with PHP-8 without JIT activated. I don’t want any extra noise in this benchmark.įirst, let’s run the script it in the current version of PHP the 7.4 docker container run -rm -v $(pwd):/script/ php:7.4 php /script/bubble.phpĪfter running it 100 times, the average time that I had was 0.10253500938416 seconds. However, I just want a slow bubble that has not to deal with other considerations. I also know that I can read it from a file. I know that I can generate a random array. I am aware that the script is not beautiful with that nasty array over there in the middle. I choose the bubble sort because it is the worst sorting method, and I can only employ it for exercises like this. Note that the version of PHP-8 that I am going to use is not final.įirst of all, let’s define the code to run. But let’s see if the approach fulfills our expectations In theory, JIT will increase the speed of an application due to how it handles the compilation of the PHP scripts (I am oversimplifying). While this major version is coming with multiple new features like union types, static return, and weak maps, the most anticipated improvement is the JIT compiler. At the end of this year, PHP-8 will be a reality.
0 Comments
Leave a Reply. |