-
Notifications
You must be signed in to change notification settings - Fork 7.8k
random: Perform fewer iterations if SKIP_SLOW_TESTS is set #12279
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
Conversation
people running with SKIP_SLOW_TESTS don't want to wait for 1000x iterations of each engine. also 10x iterations should be sufficient to catch many potential issues
this whole thing is for performance anyway, so might as well do it in a performant way
Thank you for the idea. I've applied this check to additional tests and made some small changes to your changes (increasing the numbers a little and turning the |
yw!
Nice!
Have you ever really thought about what
now ask yourself, in this line of code:
do you really want PHP to waste time creating 9 copies of $i, just to immediately discard the copies? why would you want that? In C and Javascript, the compilers are smart enough to automatically optimize post-increment to pre-increment, gcc 3x does this on -O1 and above, but the PHP interpreter isn't. in PHP, |
I understand how the pre- and post-increment operator works, thank you. On my computer the difference saves roughly 1.3ns per increment or 13µs for a 10_000 iteration loop. Consistency of the tests trumps this tiny bit of increase in performance. Optimizing this should happen on the Opcache level, not the programmer level. |
Both pre- and post-inc create "copies", in that the value is copied to |
people running with SKIP_SLOW_TESTS don't want to wait for 1000x iterations of each engine. also 10x iterations should be sufficient to catch many potential issues