I'm building a text analysis utility that runs entirely client-side. When processing massive blocks of text (100k+ words), I'm running into performance bottlenecks with simple split() operations on whitespace.
I've been looking into using a Trie data structure to manage memory and count unique words more efficiently, but I'm curious about the trade-offs:
Does the overhead of building the Trie structure in JS outweigh the memory savings for large inputs?
Are there specific Web API features (like Web Workers) that are recommended to prevent UI thread blocking during this process?
I've already implemented a basic version over at https://wordscountertool.com/ using standard Maps, but I'm looking to scale for better performance.