2 ms·
Wow, not even an efficient data structure, just an almighty string! On one hand, that's pretty disgusting. On another, it's an impressive demonstration of just
by oneeyedpigeon 10y ago
Wow, not even an efficient data structure, just an almighty string! On one hand, that's pretty disgusting. On another, it's an impressive demonstration of just how fast everything is nowadays; I wonder if the javascript interpreter in my browser does any kind of optimisation on that string in order to perform such gargantuan indexOfs.
- theandrewbailey 10y agoI think a 6MB string is preferable to calculating pi to 6+ million digits in JS on each load.
- oneeyedpigeon 10y agoI certainly wasn't suggesting that! Surely there's a superior data structure than a string, though.
- Xophmeister 10y agohttps://en.wikipedia.org/wiki/Suffix_tree https://en.wikipedia.org/wiki/Suffix_tree