You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const fs = require('node:fs');
const readline = require('node:readline');
const sourcePath = "G:\\file.txt"; // 700 MB text file with 547 characters long lines on a windows share
const targetPath = "G:\\file.txt.copy";
const myInterface = readline.createInterface({
input: fs.createReadStream(sourcePath).setEncoding('binary')
});
fs.closeSync(fs.openSync(targetPath, 'w'));
const output = fs.createWriteStream(targetPath);
output.setDefaultEncoding('utf-8');
myInterface.on('line', function (line) {
output.write(line);
});
myInterface.on('close', function (line) {
output.end();
console.log(`Saved!`); // In node, at about 3 or 4 MB over network it shows this "Saved!", but continues copying?!
});
How often does it reproduce? Is there a required condition?
every time
What is the expected behavior? Why is that the expected behavior?
Faster stream copy
What do you see instead?
On 1 GB ethernet connection over windows share, with node v23.4.0 -> 513 seconds . It seemed a lot to me, so I tried with Bun
Same connection and share, with bun 1.1.39 -> 13 seconds.
So node is about 39x (slower)
And it's also strange that at about 3 or 4 MB file.copy, node shows the "Saved!" message but continues copying.
Additional information
On local disk, node is a bit faster than bun.
So it seems that problem is over network connection
The text was updated successfully, but these errors were encountered:
Version
v23.4.0
Platform
Subsystem
streams
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
every time
What is the expected behavior? Why is that the expected behavior?
Faster stream copy
What do you see instead?
On 1 GB ethernet connection over windows share, with node v23.4.0 -> 513 seconds . It seemed a lot to me, so I tried with Bun
Same connection and share, with bun 1.1.39 -> 13 seconds.
So node is about 39x (slower)
And it's also strange that at about 3 or 4 MB file.copy, node shows the "Saved!" message but continues copying.
Additional information
On local disk, node is a bit faster than bun.
So it seems that problem is over network connection
The text was updated successfully, but these errors were encountered: