Skip to content

Use process.stdout.write instead of console.log and increase batch size #58

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

Merged
merged 1 commit into from
Jan 12, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use process.stdout.write instead of console.log and increase batch size
`console.log` does some extra work to construct the output, and because
it's already a string, we can save some memory by using
`process.stdout.write`. See this issue for more information:
nodejs/node#1741 (comment)

This is an attempt to remedy the OOM issues when rendering all the
issues. Increasing the batch size will also help by reducing the number
of GCs.
  • Loading branch information
gdiggs committed Jan 12, 2016
commit 0ee3117d876ce9142251eaa129f04dc61e8edfe3
4 changes: 2 additions & 2 deletions bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ var analysisFiles = runWithTiming("buildFileList", function() {

function analyzeFiles() {
var batchNum = 0
, batchSize = 1
, batchSize = 10
, batchFiles
, batchReport;

Expand All @@ -214,7 +214,7 @@ function analyzeFiles() {

result.messages.forEach(function(message) {
var issueJson = buildIssueJson(message, path);
stdout(issueJson + "\u0000");
process.stdout.write(issueJson + "\u0000");
});
});
});
Expand Down