Re:XUL Layout has been removed from Firefox
by foobazgt on Sunday April 02, 2023 @12:31AM
(#35407178)
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.
Re:XUL Layout has been removed from Firefox
by gmueckl on Sunday April 02, 2023 @12:47AM
(#35407265)
How 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.
Re:XUL Layout has been removed from Firefox
by foobazgt on Sunday April 02, 2023 @01:00AM
(#35407338)
If 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.
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.