Post
Then there's the decoding state. Each line stored its state as an associative array and those string keys aren't free. PHP keeps them in a hashtable at ±250 bytes per entry. Swapping to just values [0,0,0,0] is only ±150 bytes per entry. A 10MB improvement on 110K lines.
0 reposts0 likes
The end result on a 6 MB source map: ~100x faster and ~10x less memory usage compared to axy/sourcemap. This is not a stab at axy's package btw (great lib we used for years). Our package is just optimized for our specific read path. github.com/spatie/sour... & full blogpost soon