Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Slow builds when there are many warnings/errors #286

Closed
lojjic opened this issue May 4, 2018 · 2 comments · Fixed by #305
Closed

Slow builds when there are many warnings/errors #286

lojjic opened this issue May 4, 2018 · 2 comments · Fixed by #305

Comments

@lojjic
Copy link

lojjic commented May 4, 2018

This issue is to continue discussion from: 0b11134#r28859767

Version 1.2.5 increased our build time by 4x, and I tracked it down to the above commit which implemented a sourcemap cache in a way that cache hits are impossible. Fixing the cache misses brings our build time back to normal, however there is some question whether this fix should be done with a WeakMap to allow GC or just use a simple Map.

@lojjic
Copy link
Author

lojjic commented May 4, 2018

Another possible option (if I'm understanding the code flow correctly): remove the cache object altogether, go back to creating the sourceMap = new SourceMapConsumer(...) outside the loop, but make it so that it's created lazily only after we know there are errors or warnings in the result. Seems like this would meet the goals as I understand them: it's only created once per file, it's only created if there are actually errors or warnings, and it can be GC'd as soon as its variable pointer is out of scope.

@alexander-akait
Copy link
Member

@lojjic PR welcome, let's discussion on code

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants