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

perf: reduce memory usage #276

Merged
merged 1 commit into from Apr 18, 2018
Merged

perf: reduce memory usage #276

merged 1 commit into from Apr 18, 2018

Conversation

alexander-akait
Copy link
Member

We create source map on each file and it is increase memory usage very very very lagre, but using sourceMap only for error. Let's create sourceMap only when erros/warnings were throws.

@TheLarkInn
Copy link
Contributor

Is there an outstanding issue tied to this? Before I approve I just want to make sure we tie it to the work reported.

@alexander-akait
Copy link
Member Author

alexander-akait commented Apr 11, 2018

@TheLarkInn no issue, it is own metrics in our private projects. We speedup plugin (now we don't spend time on parse source maps everytime, because we need they only when error occurs), also don't use memory for this.

src/index.js Outdated
line,
column,
});

if (original && original.source && original.source !== file && warningsFilter(original.source)) {
accWarnings.push(`${warning.replace(warningRegex, '')}[${requestShortener.shorten(original.source)}:${original.line},${original.column}]`);
} else {
accWarnings.push(`${warning.replace(warningRegex, '')}`);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix, when we don't have source map warnings not emitting 😕

Array [
"Error: main.27965655b499b10158f3.js from UglifyJs",
"Dropping unused variable a [./test/fixtures/entry.js:4,0]",
"Dropping unused variable c [./test/fixtures/entry.js:5,0]",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix error helper in tests. Now we can see all warnings in tests.

@alexander-akait alexander-akait force-pushed the perf-reduce-memory-usage branch 2 times, most recently from ef0fe8b to 88b6c07 Compare April 17, 2018 18:16
@joshwiens joshwiens merged commit 0b11134 into master Apr 18, 2018
@joshwiens joshwiens deleted the perf-reduce-memory-usage branch April 18, 2018 17:14
@alexander-akait
Copy link
Member Author

@d3viant0ne need patch release 👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants