Skip to content

Commit 0ee3117

Browse files
committed
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.
1 parent d231fa0 commit 0ee3117

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/eslint.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ var analysisFiles = runWithTiming("buildFileList", function() {
194194

195195
function analyzeFiles() {
196196
var batchNum = 0
197-
, batchSize = 1
197+
, batchSize = 10
198198
, batchFiles
199199
, batchReport;
200200

@@ -214,7 +214,7 @@ function analyzeFiles() {
214214

215215
result.messages.forEach(function(message) {
216216
var issueJson = buildIssueJson(message, path);
217-
stdout(issueJson + "\u0000");
217+
process.stdout.write(issueJson + "\u0000");
218218
});
219219
});
220220
});

0 commit comments

Comments
 (0)