3 ms·
I love high level systems languages like C/++ and Rust… but everything you said about JavaScript being slow is the same thing assembly programmers experience wh
by thechao 5y ago
I love high level systems languages like C/++ and Rust… but everything you said about JavaScript being slow is the same thing assembly programmers experience when optimizing high level systems languages.
In general, when I see C code and I’m asked to speed it up, I always use “100x” as my target baseline.
- josephg 5y agoWhoa thats a really impressive baseline to reach for when optimizing C code! I'd love to hear some war stories. As you can probably tell from my article, most of my skill at this stuff is from hard won tricks I've picked up over the years - like reducing heap allocations and packing memory for cache coherency. There's probably lots of things I just haven't learned because I haven't discovered it on my own. Do you have a blog, or any recommendations for stuff to read by you or others?
- thechao 5y agoI learned low level programming while at Intel, working with one of their performance teams; so, nothing written. In general, though, assembly is more expressive than higher level languages; it lets you “tighten up” the code the computer executes, reducing work & bandwidth. Specifically, a guy named Mike Abrash taught me some of this stuff, and he’s got some books explaining the theory in terms of practice.