News for hackers. Stuff that matters.
Re:tolower() in bulk at speed by londons_explore on Monday June 27, 2022 @05:53PM (#31901342)
All those arithmetic calculations depend on the previous...

You should get much more throughput if you can interleave them with other instructions...

I wonder if that's what the benchmarks did?

Re:tolower() in bulk at speed by dzaima on Monday June 27, 2022 @06:10PM (#31901524)
An out-of-order CPU will interleave things for you. Any modern CPU should have no issues running many iterations of the loop in parallel, as nothing should depend on the previous iteration.

But, given that the task at hand usually deals with very short inputs, there's not much to interleave with anyway.

Re:tolower() in bulk at speed by fanf2 on Monday June 27, 2022 @06:10PM (#31901520)
Hmm, yes, there are only 2 or 3 instructions that can execute concurrently - but your observation made me realise I can eke out another by masking is_ascii more thoroughly. Thanks!

Bulk throughput isn’t really my aim, it’s just a convenient way to get numbers big enough to be easily measurable :-)