Daniel Lemire, a computer science professor, writes about squeezing speed out of software, covering SIMD, number parsing, and low-level optimization.
Commenters note his skill at getting performance from hardware, call his blog well worth reading, and say his technique explanations are easy to follow.
Very cool post. Thank you.
This article, and its many links, are helping noob me learn how to ask about I/O perf.
TechEmpower benchmarks HTTP servers. While contestants continue to improve, I've long been curious what the theoretical fastest HTTP server could be. https://www.techempower.com/benchmarks/
Basically, an update to the "C10K problem" for the year 2021. https://en.wikipedia.org/wiki/C10k_problem
A bit like how Daniel Lemire initially thought about parsing JSON. Paraphrasing: Why can't a JSON parser run at wire speed? "Parsing JSON quickly: early comparisons in the wild"
https://lemire.me/blog/2019/03/02/parsing-json-quickly-early-comparisons-in-the-wild/
--
Also, I really appreciate including the sound and cooling considerations. It's just great seeing the process of system design accommodating (balancing) multiple goals. Bravo.
That article is a great example: It defines "debugger" as "single-stepping through code", and then argues against that. It's fine to argue against "single-stepping through code" as a default technique, but artificially limiting the scope.
EDIT: one of the comments by the author makes it very clear: they don't consider lots of things you can do with e.g. gdb as "using a debugger": https://lemire.me/blog/2016/06/21/i-do-not-use-a-debugger/#comment-245502 </EDIT>
The submitted article here is similar, by opening with that ridiculous example and pretending that's what using a debugger means. Debuggers don't make you bad at finding problems. Not knowing when to use which tool makes you bad at it. (And knowing how to make new tools out of your existing ones is also quite helpful)
Integers are simple to parse, but from_chars is a great improvement when parsing floats. It's more standardized on different platforms than the old solutions (no need to worry about the locale, for example whether to use comma or dot as decimals separator) but also has more reliable performance in different compilers. The most advanced approaches to parsing floats can be surprisingly much faster than intermediately advanced approaches. The library used by GCC since version 12 (and also used by Chrome) claims to be 4 - 10 times faster than old strtod implementations:
https://github.com/fastfloat/fast_float
For more historical context:
https://lemire.me/blog/2020/03/10/fast-float-parsing-in-practice/
Zen is great if you have moderate utilization code around the ~2-3 instructions per cycle mark. This is common for most compiled C and C++ where it hasn’t been specifically tuned for ILP. In these scenarios even if Intel has an extra ALU it won’t be used anyways.
It took 3 days of tuning to get to a point where Intel started pulling away from my Zen2 chip. No matter what I did the Zen2 would not get faster because it was already at max utilization.
Lemire had a blog [1] talking about this on here a few months ago as well. Most people were surprised because frankly Zen2 is very competitive with Intel for normal compiled code.
https://lemire.me/blog/2019/12/05/instructions-per-cycle-amd-versus-intel/
I don't think that's quite correct because there are many optimizations which are impossible (or nearly impossible) to do after a system is implemented. Daniel Lemire wrote an excellent post on this exact subject https://lemire.me/blog/2023/04/27/hotspot-performance-engineering-fails/.
In terms of programming languages, I think python is an excellent example of a language which has many features that have ended up making it extremely difficult to optimize even compared to other dynamic languages like LISPs. Even if you don't have to worry about backwards compatibility, there are design decisions that can limit performance which end up necessitating a rewrite of the entire system to actually change.
> 0. Spreadsheet is all you need.
I HATE when people use Spreadsheets to do anything besides simple math.
http://lemire.me/blog/archives/2014/05/23/you-shouldnt-use-a-spreadsheet-for-important-work-i-mean-it/
TL:DR your work is not reproducible and we can't see what you did to get to your numbers. A million examples of why this is bad.
Also
> 1. Python script is good enough
You mean Python with pandas and numpy?
I use R which is also a great choice
> 2. Java/Scala is way to go.
For you but the vast majority of Data Scientist don't use either and their choice for people is not universal. Julia looks like a great new comer. I again mainly use R.
> 3 & 4 are good points.