Get the latest tech news
The Fifth Kind of Optimisation
A little while back I wrote about what I considered to be the four main kinds of optimisation: - Use a better algorithm. - Use a better data-structure.
I remember getting a 2 core CPU, and realising that while it made my operating system a little bit faster – my web browser could render a page while my compiler ran in a terminal – no individual program benefited directly. Frankly, I quickly lost faith in my ability to reason about multi-threading after writing some C code which parallelised a problem I cared about, and finding that I’d slowed it down, and introduced bugs which, at the time, I didn’t understand at all. These traits are (mostly) automatically implemented and they make it virtually impossible to use types in incorrect ways: try to do something with say, Rc<T>(which is neither Send nor Sync) in a multi-threaded context and you’ll get a compile-time error.
Or read this on Hacker News