Isnt it evaluated linearly to be deterministic …? If it was a Trie datastructure what would that buy you and would “a lookup” still be deterministic for a sysadmin to understand precedence defined within the file.
I suppose a big question is – is it quicker to find a plain needle in the file vs build a Trie for a typical hosts file …
I find it strange that etc hosts is not parsed into a trie. it is used linearly.
Isnt it evaluated linearly to be deterministic …? If it was a Trie datastructure what would that buy you and would “a lookup” still be deterministic for a sysadmin to understand precedence defined within the file.
I suppose a big question is – is it quicker to find a plain needle in the file vs build a Trie for a typical hosts file …
log time instead of linear time. This allows you to have a very large hosts file without slowing down internet use.
yeah, you can ensure that happens in the implementation.
Building the trie is slower than searching through the file but the only needs to be done when the file is edited.
Have you numbers on how big it would have to be? Without knowing that, this reeks of premature optimization.