33 ms·
I love how they embrace toy apps for benchmarking. [1] I've found that I learn a lot about writing fast code by writing a toy app, measuring how long it takes
by PopeDotNinja 8y ago
I love how they embrace toy apps for benchmarking. [1] I've found that I learn a lot about writing fast code by writing a toy app, measuring how long it takes to run N times, making a small change and benchmarking the change.
I was recently playing with generating v4 UUIDs in Elixir, and it was fun to try writing code that was nominally faster than the most popular UUID library out there. It was also interesting to see how the code gets less maintainable, more repetitive, are harder to read when I started trying to shave nanoseconds off the average run time. It's also fun to start realizing that the program can't get much faster because your approaching the physical limits of the hardware.
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/why-measure-toy-benchmark-programs.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...