Removing the isset() shoved off 2.5% of wall time, that is an awesome idea and was easy to check. Making $chunk_start < $chunk_end the expression of the while loop and moving the fgets() into the loop body shove off another 2.7% of wall time on my machine.
I'll update the blog post once I am back from DutchPHP. Thats awesome! Thank you!
Oh, I'm glad both changes helped! Compared to the fread ones they were much simpler to implement, but I just realized we can simply use stream_get_line to fetch the station name, which is faster and simpler than the other approaches!
Removing the
isset()shoved off 2.5% of wall time, that is an awesome idea and was easy to check. Making$chunk_start < $chunk_endthe expression of thewhileloop and moving thefgets()into the loop body shove off another 2.7% of wall time on my machine.I'll update the blog post once I am back from DutchPHP. Thats awesome! Thank you!
Oh, I'm glad both changes helped! Compared to the fread ones they were much simpler to implement, but I just realized we can simply use
stream_get_lineto fetch the station name, which is faster and simpler than the other approaches!Replied on twitter already, but for visibility: switching to
stream_get_line()shoved off another 15%This is awesome!