Created
August 21, 2022 07:48
-
-
Save ZacharyL2/d2f839cd126773591d79384e9ee8815b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.time('Time'); | |
const fs = require('fs'); | |
const readline = require('readline'); | |
void (async () => { | |
const rl = readline.createInterface({ | |
input: fs.createReadStream('test.json'), | |
crlfDelay: Infinity, | |
}); | |
rl.on('line', (line) => { | |
// console.log('line: ', line); | |
}); | |
await new Promise((res) => rl.once('close', res)); | |
console.log(`Used ${process.memoryUsage().heapUsed / 1024 / 1024} MB`); | |
console.timeEnd('Time'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment