Get the latest tech news

Performance optimization is hard because it's fundamentally a brute-force task


I’m not talking about skill, knowledge, or convincing a world focused on radical acceleration that optimization is necessary. Performance optimization is hard because it’s fundamentally a brute-force task, and there’s nothing you can do about it. This post is a bit of a rant on my frustrations with code optimization. I’ll also try to give actionable advice, which I hope enchants your experience.

I have a post on integer formatting in the works, covering a very particular algorithm design – and I still haven’t finished it because there’s like five different choices to make, I have no idea how they impact each other, and I need to analyze 25 variants to claim which one’s the best in conscience. Small modifications here can lead to drastic end performance changes due to interactions with CPU cache, branch and memory access prediction, the discrete nature of recursive cut-offs, and floating-point precision (for big integer multiplication via FFT). They allow you to write assembly with the syntax and capabilities of Rust or C++, but don’t you dare forget that the arr.map(|x| x / c) you wrote will invoke idiv without performing obvious libdivide-style precalculations.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Hard work

Hard work

Related news:

News photo

Hard work and happy accidents: why do so many of us prefer ‘difficult’ analogue technology?