Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
fixup! assert: use less read operations
  • Loading branch information
BridgeAR committed May 3, 2019
commit 1ae35715cc344b05ffda402746fcec33a2718666
4 changes: 2 additions & 2 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ function getCode(fd, line, column) {
let lines = 0;
// Prevent blocking the event loop by limiting the maximum amount of
// data that may be read.
let maxReads = 2 ** 5; // bytesPerRead * maxReads = 512 kb
const bytesPerRead = 2 ** 14;
let maxReads = 32; // bytesPerRead * maxReads = 512 kb
const bytesPerRead = 16384;
// Use a single buffer up front that is reused until the call site is found.
let buffer = Buffer.allocUnsafe(bytesPerRead);
while (maxReads-- !== 0) {
Expand Down