-
Notifications
You must be signed in to change notification settings - Fork 362
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
array-set has terrible memory usage #259
Comments
We had a brief discussion of this on irc. I believe we're still reluctant to require anything after ES5; but on the other hand, feature detection would be ok. So if you wanted to submit this as a PR that used |
Sure, but curious why the reluctance given nodejs 4 is the minimum supported? |
I don't know the answer, sorry. I'm just learning about this project. Is 4 really the minimum? All I saw was |
4 is the lowest version on the nodejs website... |
Maybe you need to up your package.json node version. projects like webpack are already operating on the assumption of es6. Webpack is upgrading its entire codebase to use classes, etc. |
PR is here: #260 |
Yeah, that would be good. I will try again to find out. |
Given the recent test failures with the old version of node, I think it is fine to just move on to the future; that is, assume |
… the API the same. That file needs careful review. Everything else is pretty straightforward. Fixes mozilla#334. Fixes mozilla#259.
Hi! This was fixed on |
Ah ignore that - the PR that auto-closed this wasn't the one that originally fixed the issue. This was fixed originally in #260, which made it into 0.5.7. Sorry for the noise! |
We have a large project that is build using webpack, which uses source-map to generate the sourcemaps.
There are issues with performance of the phase that generates the sourcemaps so we did some profiling. One thing we noticed right off the bat is the sharp sawtooth shape of the memory usage graph of the node process. This basically means that a lot of the time is spent garbage collecting. Digging deeper, we profiled using the google chrome dev tools and noticed that one of the things allocating a lot of memory is array-set. It was using gobs of memory by making large source strings keys into an object which causes string copies. We monkey patched it on our side, but it probably makes sense to change this class to use some modern javascript Set/Map data structure so everybody gets the benefit.
Here's the monkey patch we use:
The text was updated successfully, but these errors were encountered: