Just like the best advice on learning to write code is to write code, the best way to learn how to optimize performance is to optimize performance.
Ask HN: How can I learn about performance optimization?
91–100 of 153 posts
Re: Ask HN: How can I learn about performance optimization?
#92Measure everything and be extremely critical. Be ready to challenge common and popular held assumptions. Here is something I wrote about extreme performance in JavaScript that is discarded by most programmers because most people that program JavaScript professionally cannot really program. https://github.com/prettydiff/wisdom/blob/master/performance...
These are good performance improvements, but they clearly come at a cost. Race cars are faster than sedans, but the tires fall off and they explode without a team of engineers supporting them. The best people I can hire can mostly use a computer. They can’t build something like this, or even build upon it. They need recipes to reuse to accomplish tasks, and the more something is custom, the harder it is to teach. And…
Most people capable of writing original software can easily apply the things I suggest, but most people writing JavaScript are not capable of writing original software. That doesn’t mean guidance for superior performance is out of alignment. It means there are fundamental problems with hiring and training.
Using your example I once saw a Puerto Rican racing team make a lot of money with their custom car. They took an old 80s Mazda small sedan and dropped in a large Ferrari engine and customized the suspension. This is something innovative they did to make money by winning competitions, because that pays better than just changing tires. Shops that only change tires or change oil have that does to a science to maximize human productivity, akin to copy/paste.
Re: Ask HN: How can I learn about performance optimization?
#93I 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?
#94Earlier quoted context omitted.
If you can run the daily batch processing in parallel, can't you have one batch start at T+0, the next one starts at T+24h, then the first one finishes at T+28h and so on?
That leads to an infinite backlog no ? If you need more than 24h to process 24h of data ?
If jobs must be executed one after another, then you absolutely create an infinite backlog.
Re: Ask HN: How can I learn about performance optimization?
#95Agner Fog’s optimization manuals are pretty good https://www.agner.org/optimize/
Definitely still useful, but some info, esp on some C++ things, is already outdated or even wrong. But still a good resource if approached with "trust but verify" mindset
To be honest I've not approached the material in a few years. Can you pinpoint which areas are wrong?
Re: Ask HN: How can I learn about performance optimization?
#96Former 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?
#97Re: Ask HN: How can I learn about performance optimization?
#98To do this you must find ways to “cheat”. This can be of various forms. Better algorithms, better data structures, precomputation, caching. At some point you will exhaust low hanging fruit and need to dig into lower level aspects of the code or its compilation.
Anyway, best way to learn is to do it, go depth first and always check your work thoroughly. (It is easy to optimize yourself into a solution that is not working properly).
Re: Ask HN: How can I learn about performance optimization?
#992. Read the blog posts people wrote about the 1BR challenge where they tried to figure out the fastest way to process 1 billion rows of data
3. Brendan Gregg‘s blog
4. Google/YouTube how to profile code in your desired language
Re: Ask HN: How can I learn about performance optimization?
#100A good talk, doesn't go deep and instead goes a bit wide. https://www.youtube.com/watch?v=6RlloT_6WxA
This one explains the black magic the CPU makes have been doing. If you going to be optimizing code you should know your hardware. https://www.lighterra.com/papers/modernmicroprocessors/
Aditional note: I've noticed C++ conventions have a habit of having performance related talks, YT is your friend.