3 ms·
Performance/memory is the ultimate leaky abstraction. Once you also lay out perf as a requirement in your abstractions it can really help mitigate these types
by vvanders 7y ago
Performance/memory is the ultimate leaky abstraction.
Once you also lay out perf as a requirement in your abstractions it can really help mitigate these types of problems.
- skybrian 7y agoI'm curious, how do you do that? I don't know of any languages the cover performance in their abstractions, only informally via documentation.
- vvanders 7y agoVHDL/Verilog does but you're not going to write many apps in that. At a high level: 1. Brute force with automated tests. Great if you have known datasets and platforms. 2. Work from most constrained hardware first. Easy to say, hard to do. Back in the X360/PS3 days almost everyone screwed this up and developed for X360 first. 3. If you need to do N of the same things fast, use an contiguous array. If you want to enforce that make the array part of your API. CPU prefetchers are amazing and love predictable memory patterns. 4. Rust is one of the few languages that bakes semantics into the language that line up well with modern architectures. Specifically Rust can automatically apply restrict semantics. It also forces you to think about ownership upfront in a way that tends to be performance friendly.
- skybrian 7y agoYes, these are all good performance tips, but you're still testing the system as a whole. Performance leaks across the abstractions.