3 ms·
> Once you understand a system – deeply understand – it can do things that its designers never thought possible. You can push hardware beyond its apparent limit
by dehrmann 6y ago
> Once you understand a system – deeply understand – it can do things that its designers never thought possible. You can push hardware beyond its apparent limits.
The interesting question is how much of a performance gain is there from hyperoptimizing for an architecture, how much from porting your code to C (or maybe assembly), and what's the cost. Considering how much more complex software has gotten than Wolfenstein 3D, the porting cost would be pretty expensive. I'm also not sure if the performance gain would be as good as hoped; compilers have gotten a lot better, architectures have gotten a lot more complex and harder to understand.
- bobthepanda 6y agoI mean, this is still done (not to as absurdly a degree as in the past) with consoles, which for the most part have a few permutations per generation at most. The big thing that would cause a trend away from this would be the demand to target cross-platform. I wouldn't call Windows software particularly optimized, and it wouldn't make sense to do these optimizations for Windows, because there are countless permutations of hardware that can run Windows 10 off the shelf, so optimizing for all of those would be a Sisyphean task. Combine that with the fact that even console games these days are generally targeting cross-platform on multiple consoles and PC, and this type of optimization is largely out of the realm of the possible.
- mhh__ 6y agoThe performance increases from using C these days really come from it forcing you to avoid abstraction rather than access to the hardware. If you imagine the amount of indirection a Python program has just to add two numbers, that's why C is "fast". Compilers are clever, but they generally don't bother and aren't really allowed to look too far away from a given expression or function i.e. Extracting very high level information about even integers still requires manual annotation - GCC and LLVM will happily propagate parity through an expression but declaring an invariant about an integer inside a struct is not possible even with extensions AFAICS The issue we have, now, however isn't that your code (or any code, ideally) is slow but that the depth of the tree from your library call down to the missile launching is too deep. There's just too much crap in between the important stuff.
- eru 6y agoIn principle, a higher level language like eg some variant of Haskell, would give compiler much more freedom to optimize. Including making collapsing what remains at runtime of the path between what your code describes and the missile launching. In practice, we aren't quite there yet.