DEV Community

Discussion on: Processing One Billion Rows in PHP!

Collapse
 
moshedolev profile image
Moshe Dolev

First, really beautiful how you improved the code step by step, and eventually got X60 boost - from half an hour to half a minute. WOW !!
Second, you note that the final best result you got is much different from what is seen in the leaderboard because of a very different hardware. It would be interesting to run this test on a similar hardware. This way we will get an indication if and how much php is slower than java.

Collapse
 
codemunky profile image
codemunky

I got you. I have the exact same AX161 from Hetzner. The final version of his code executes in 15.4 seconds (with JIT & parallel).

Collapse
 
realflowcontrol profile image
Florian Engelhardt

Whoop whoop, that's awesome

Collapse
 
realflowcontrol profile image
Florian Engelhardt

May I ask you if you could re-run the script with the changes that @xjakub suggested? I created a file with those changes at github.com/realFlowControl/1brc
I am very curious about the time you get on that machine

Thread Thread
 
codemunky profile image
codemunky

With pleasure.

Ran it five times as my server is a bit busier today: 13.4/12.8/12.9/12.6/12.5

And re-ran the old version five times, for completeness: 16.3/16.0/15.9/15.9/15.9

Thread Thread
 
codemunky profile image
codemunky

Interestingly it doesn't seem to really scale past 24 threads. Between 16 and 24 it gets faster the more threads I chuck at it. Over 24 and it starts to slow. nice/ionice make no noticable difference