by omginternets · 9y ago · 0 comments
I'm probably guiltier of this than I realize, especially since I loooooove me some abstraction.
From there, you would be well served by working through Hennessy and Patterson's Computer Architecture and Computer Organization and Design.
In parallel, you could work through a book on Operating Systems, maybe even playing with the code for a toy system (e.g., http://pages.cs.wisc.edu/~remzi/OSTEP/ or https://pdos.csail.mit.edu/6.828/2016/xv6.html).
An alternative or perhaps parallel approach would be to play the assembly games put out by Zachtronics.
Secondly, abstraction doesn't necessarily track with efficiency/inefficiency.
[0]: https://learncodethehardway.org/c/
[1]: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf
(Nonetheless, thanks for your suggestion!)
https://www.amazon.com/Racing-Beam-Computer-Platform-Studies...
Though, instead of reading, you really should just get over your complex and try writing some efficient code.
It's not a complex. I'm always very surprised by this attitude. Theory serves practice.
Case and point: the OP mentions that an understanding of cache architecture enables you to reason about which data-structures exhibit good cache locality. Discovering that hashtables have poor cache locality by trial-and-error seems like a waste of time compared to gaining theoretical insights.
That said, spend a week with C and valgrind/cachegrind. There's a lot of theoretical stuff that is hard to get at (or is for me) without a little exposure to how the system works. a coupe hours here and there will extend your mental model to include the various layers of cache. That'll make the more esoteric stuff more accessible.