4 ms·
"Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him." I think
by jerf 7y ago
"Fast inverse square root is genius but it would just be way-too-clever technical debt if Carmack hadn’t written it and others didn’t learn from him."
I think the difference here is that Carmack was working in a space where fast inverse square root was the difference between the program working and it not working. At that point, it doesn't really how matter "clever" in any bad sense of the term the code is.
Carmack works in 3D engines, which even today is a space where people are trying to wring every last cycle out of them. It's perfectly appropriate when programming in a space where every last cycle counts to program as if you're in a space where every last cycle counts.
I don't work in such a space, so I don't program that way. But while I haven't got anything as "clever" as FISR, I have got some things like non-obvious database schemas for certain performance reasons that if my successors don't find and read the comments I've left about why the schemas are that way, they could well get themselves into some trouble if they try to "fix" it.
- zild3d 7y agoagreed, you still see clever c hacks today in the embedded world, because resources are still constrained for many devices
- Const-me 7y ago> was working in a space where fast inverse square root was the difference between the program working and it not working Pentium 3 released in January 1999. That CPU, along with all newer ones, support SSE which has RSQRTPS instruction, faster, also much more precise approximation. AMD had it before, PFRSQIT1 / PFRCPIT2 in 3DNow from 1998. Quake 3 Arena released in December 1999. The point of using that approximation is running on older hardware, like Pentium and Pentium 2.
- seba_dos1 7y agoSo, basically a difference between the program working and not working for most users.