https://www.computerenhance.com/
This course is excellent and I cannot recommend it to OP highly enough. A great book to go with it is Computer Systems: A Programmer's Perspective (CSAPP).
Ask HN: How can I learn about performance optimization?
131–140 of 153 posts
Re: Ask HN: How can I learn about performance optimization?
#132What you really want to learn about is observability, benchmarking and instrumentation. Once you are an expert in these topics for your domain, optimization will be about making obvious choices within localized constraints.
Also, while premature optimization is obviously a problem, knowing more about how to actually write optimized code can help you make more informed decisions earlier on in the development process.
Re: Ask HN: How can I learn about performance optimization?
#133I swear, nobody actually read OP's post. The top five comments are "here's some personal advice about general rules of thumb, without any links to actual resources!"
Kudos to levodelellis, whose post is at #6 root comment and contain some links and drops some names.
Re: Ask HN: How can I learn about performance optimization?
#134Former HFT dev here. Know fundamentals: sources of performance issues = things that eat/waste CPU cycles, things that reach too far down the memory hierarchy. Usually the latter. E.g. L2 cache to RAM - order of magnitude slower; RAM to disk: 4+ orders of magnitude slower. Things that eat CPU: iterations, string operations. Things that waste CPU: lock contentions in multi-threaded environments, wait states. You can us…
Re: Ask HN: How can I learn about performance optimization?
#135If you're new to this area, I would first start by understanding which profiling tools you can use depending on the OS, languages and systems involved. Even if your system is not C++, I've always enjoyed this talk and the subsequent discussion which tackles some of the problems associated with some programming practices and the impact on performance. CppCon 2014: Mike Acton 'Data-Oriented Design and C++' https://yout…
Re: Ask HN: How can I learn about performance optimization?
#136Earlier quoted context omitted.
Excellent point. To be honest I've not approached the material in a few years. Can you pinpoint which areas are wrong?
My biggest concern is his "Optimizing software in C++" (Copyright © 2004 - 2023. Last updated 2023-07-01 - so it's claimed to be quite "fresh") [ https://agner.org/optimize/optimizing_cpp.pdf ]. Some things could be attributed to just bad wording, but some... IMO, either don't tell all the truth, or tell outright wrong things. For example, For example, on page 36 he asserts: "Accessing a variable or object through a…
This is indeed an important gotcha! Let's say you have a filter and want to process an array of floats. If the coefficient is a struct member and has the same type as the audio samples, you must cache it in a local variable, otherwise the compiler might reload it from memory on every loop iteration. ('restrict' can somewhat help with these kind of aliasing issues, but you need to be careful.)
Re: Ask HN: How can I learn about performance optimization?
#137Casey Muratori did many lectures. Check out his yt page playlist. Start with the one titled software quality https://www.youtube.com/@MollyRocket/playlists I heard good things about his course https://www.computerenhance.com/ Agner Fog manuals are good too https://www.agner.org/optimize/#manuals A site to look up instruction timings is https://uops.info/table.html
Re: Ask HN: How can I learn about performance optimization?
#138>What are some good resources for learning about performance optimization? I swear, nobody actually read OP's post. The top five comments are "here's some personal advice about general rules of thumb, without any links to actual resources!" Kudos to levodelellis, whose post is at #6 root comment and contain some links and drops some names.
Re: Ask HN: How can I learn about performance optimization?
#139Former HFT dev here. Know fundamentals: sources of performance issues = things that eat/waste CPU cycles, things that reach too far down the memory hierarchy. Usually the latter. E.g. L2 cache to RAM - order of magnitude slower; RAM to disk: 4+ orders of magnitude slower. Things that eat CPU: iterations, string operations. Things that waste CPU: lock contentions in multi-threaded environments, wait states. You can us…
Can you suggest/recommend some books to learn these things in depth?
https://www.brendangregg.com/systems-performance-2nd-edition...