Optimization by memoizing computed LinearizedTrie