Also,
> Solution’s simplicity and elegance might provide a welcomed retreat from fighting Webpack configs.
I chuckled.
Also,
> Solution’s simplicity and elegance might provide a welcomed retreat from fighting Webpack configs.
I chuckled.
I think SpiderMonkey is 60x faster than V8 there because of an optimization we have to avoid quadratic behavior while flattening ropes, it's described here: http://searchfox.org/mozilla-central/rev/0f92c398ce929a3f3d9...
Basically JS engines do string concatenation lazily: they create a rope, and then the rope is flattened when needed [0]. When appending/concatenating one character at a time and flattening after each concatenation, we avoid quadratic behavior (copying the same chars over and over again while flattening) by overallocating so we can simply append while flattening. The source code comment has the full details.
I just don't understand the obsession with configuration oriented programming these days. Sure, it looks nice for common paths, but as soon as you're doing anything they don't have an option for, you have to write code just like before. But now the choice toy have to write is some awful hack bolted on to the side of your configuration. It's a mess.
> However when I did necessary changes to the less_dart code I discovered that it actually became several times slower. Hmm.
It's almost like those kuh-razy V8 people knew what they were doing and wrote all that code for a reason.
I don't get what's the connection between V8, less_dart and naive implementation that `RegExp.matchAsPrefix` had in Dart VM.