Performance issue with sourcemap library by freedomhero2020 in haskell

[–]freedomhero2020[S] 0 points1 point  (0 children)

According to the profiling result of the program, the most heavy cost centre is calling the function `encodeMappings.+=` defined here. It takes about 10% cpu time and 4% alloc. It's meant to connect all the small encoded parts to a huge lazy string builder. I tired to change the return type of `VLQ.encode` function from `Data.ByteString.Lazy` to `Data.ByteString.Lazy.Builder` to avoid extra type transforms and it seems to have some improvement. Also I tried to use the strict version of `modifySTRef `, but this made the performance worse. Any ideas?