3 ms·
Feature creep definitely bloats and slows software in meaningful ways, but it's not via checking feature flags. In the worst case, a feature test would be a ca
by foobazgt 4y ago
Feature creep definitely bloats and slows software in meaningful ways, but it's not via checking feature flags.
In the worst case, a feature test would be a cache miss, requiring a read from main memory. That's somewhere in the ballpark of 50ns. So, you could test 1000 different flags, every single one being a cache miss, and you'd still be 100x faster than what humans can generally perceive. In reality, almost all of those reads will be cache hits unless you're doing something pathalogical, so you're probably talking on the order of 100ns for the whole lot.
- gmueckl 4y agoHow many of these do you do once per document, once per input token in the lexer, once per token in the parser, once per DOM node, once per CSS rule...? It's not always a one time cost.
- foobazgt 4y agoIf you're executing 10M flag tests per document, something has gone very horribly awry. If you discover production code that is doing this, send the maintainers a PR.