> The time to solve performance, and get the 1000x wins, is in the design phase, when you can't profile.
How does this make practical sense? I find it immensely easier to fix performance issues by profiling, benchmarking, finding hotspots. Things that weren't obviously performance bottlenecks during design become obvious when you profile.
Interesting write-up though. I haven't properly tried zig but I like reading these "initial impressions" style articles about it.
[–] chrisco255 2 days ago
[–] elendilm 2 days ago
Eg: < Optimize for the slowest resources first (network, disk, memory, CPU) in that order, after compensating for the frequency of usage, because faster resources may be used many times more. For example, a memory cache miss may be as expensive as a disk fsync, if it happens many times more.>
This is just obvious common sense. Great read.
[–] gf000 1 day ago
I don't think it's possible in the general case, it's way too complex for that. Sure for trivial examples it's trivial to claim one program is faster than the other, but can you really claim that your special allocator used in one place plus the extra argument used in calling that function is worth it without writing both options and measuring it? Like even measuring it is non-trivial, will it be inlined at the use site, how is it called, etc.
[–] austin-cheney 2 days ago
[–] nvme0n1p1 2 days ago
[–] Ygg2 2 days ago
Plus not all speed-ups are made equal. Some speedups of a part of program can have no or even negative impact (as in making part of program faster slows down overall program execution).
[–] chrisco255 2 days ago
[–] grg0 2 days ago
[–] narnarpapadaddy 2 days ago
[–] tialaramex 1 day ago
That sounds about right, a DS&A course which introduces Hoare's Quicksort, which is old enough to draw a pension, as if that's the state of the art.
Introspective sorting is more than a quarter of a century old and yet probably most people with a CS degree do not even know it exists. What a poor excuse for an engineering discipline this is.
Their big-O studies will lead them to conclude, as a Fortran textbook I've studied did almost forty years ago, that Heapsort is the right choice. Same big-O best case as Quicksort, easier to write but a better worst case. Of course the Fortran textbook does have the heart to mention that Heapsort is actually noticeably slower - but same big-O as if that's what your users will care about.
With a following wind and enough free time (or if they ask an LLM) they might come up with introspective sorting, putting them only a few decades behind the state of the art. Amazing.
[–] vlovich123 2 days ago
[–] rcxdude 2 days ago
[–] Ar-Curunir 2 days ago
If you’re already in your spec thinking about performance concerns at that level, then you can get pretty good performance in almost any language, though some languages might make it a little (lot) easier than others. But again I don’t think eg Zig vs Rust would be a big perf difference there.
Full guide for ref: https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI...