You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently noticed that if we remove sourcemap generation from our build process, the build speeds up from around 15s -> 5s.
When we ran it through the profiler, we noticed that a lot of time is being spent in SourceMapOutput#add. In particular, every time we add a mapping, it has to iterate through the source file and split it into sourceLines. It does this over and over again for the same file.
it has to iterate through the source file and split it into sourceLines
I noticed this also when I started working with the source code and happened upon the source map generation part. This part of the Less library is extremely inefficient, and line counting could be done at the parsing stage (but probably not without a parser rewrite, I'm guessing). So, yes, definitely, PRs welcome.
Yes, the current line counting method did make sense initially since then it was used only once to generate a error, but now it's quite painful (same way it's quite a story if you need to generate a warning pointing to a file/line too). Though the refactoring of all this would need "some" efforts...
Activity
matthew-dean commentedon Mar 1, 2016
I noticed this also when I started working with the source code and happened upon the source map generation part. This part of the Less library is extremely inefficient, and line counting could be done at the parsing stage (but probably not without a parser rewrite, I'm guessing). So, yes, definitely, PRs welcome.
seven-phases-max commentedon Mar 25, 2016
Yes, the current line counting method did make sense initially since then it was used only once to generate a error, but now it's quite painful (same way it's quite a story if you need to generate a warning pointing to a file/line too). Though the refactoring of all this would need "some" efforts...
nicks commentedon Mar 25, 2016
oh we already merged a pr for this. Forgot to close the issue. thanks!
seven-phases-max commentedon Mar 25, 2016
Ah, thank you!
matthew-dean commentedon May 9, 2016
Re-opened due to reversion of #2834.
nicks commentedon May 31, 2016
re-tried as #2903