only optimising Trie when it's size is big enough to benefit from it