-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SourceMap generation is unnecessarily slow #2828
Comments
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... |
oh we already merged a pr for this. Forgot to close the issue. thanks! |
Ah, thank you! |
Re-opened due to reversion of #2834. |
re-tried as #2903 |
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.
https://github.com/less/less.js/blob/master/lib/less/source-map-output.js#L57
are there any plans to speed this up? Would you accept a pull request to fix this?
The text was updated successfully, but these errors were encountered: