3 ms·
I don't know. But Ben Hoyt got a similar time as me too. I saw your GitHub PR. Moreover, looking at your program, I would expect it to be slower than the other
by burntsushi 6y ago
I don't know. But Ben Hoyt got a similar time as me too. I saw your GitHub PR. Moreover, looking at your program, I would expect it to be slower than the other optimized versions (Rust, C, Go). Because it doesn't actually implement the optimizations in those programs! So not only is your code slow on two different compilers, but it also matches my prior.
You're the one who came out of the woodwork and said a bunch of nonsense. Maybe put in a little effort here to try to figure things out. Like, oh, I don't know, run the benchmarks on the other programs to compare relative timings. Like I did. Or show the commands you used to compile. Like I did. Or show the commands you used to run the program. Like I did. You want me to hold your beer? Fine. But put in the work.
My bet is that you're being just as sloppy now as you were in your comments. You're probably using the wrong input. See https://github.com/benhoyt/countwords/blob/aa45dcfd7eff177c8052cc13038ac692f16e5049/benchmark.py#L10 https://github.com/benhoyt/countwords/blob/aa45dcfd7eff177c8... and https://github.com/benhoyt/countwords/blob/aa45dcfd7eff177c8052cc13038ac692f16e5049/test.sh#L5 https://github.com/benhoyt/countwords/blob/aa45dcfd7eff177c8...