Skip to content

Commit 4e44ece

Browse files
committed
stream: fixup stream/iter benchmarks and test assertion
1 parent b198a49 commit 4e44ece

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Measures the cost of constructing stream infrastructure (no data flow).
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const { Readable, Writable, Transform, PassThrough } = require('stream');
77

88
const bench = common.createBenchmark(main, {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// Reads a real file through the three stream APIs.
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const fs = require('fs');
77
const { Writable, pipeline } = require('stream');
8-
const tmpdir = require('../../../test/common/tmpdir');
8+
const tmpdir = require('../../test/common/tmpdir');
99

1010
tmpdir.refresh();
1111
const filename = tmpdir.resolve(`.removeme-bench-file-read-${process.pid}`);

benchmark/streams/iter/throughput-broadcast.js renamed to benchmark/streams/iter-throughput-broadcast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// stream/iter uses broadcast() with push() consumers.
44
'use strict';
55

6-
const common = require('../../common.js');
6+
const common = require('../common.js');
77
const { PassThrough, Writable } = require('stream');
88

99
const bench = common.createBenchmark(main, {

benchmark/streams/iter/throughput-compression.js renamed to benchmark/streams/iter-throughput-compression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Tests real-world compression performance across stream APIs.
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const { Readable, Writable, pipeline } = require('stream');
77
const zlib = require('zlib');
88

benchmark/streams/iter/throughput-identity.js renamed to benchmark/streams/iter-throughput-identity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Compares Node.js classic streams, Web Streams, and stream/iter.
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const { Readable, Writable, pipeline } = require('stream');
77

88
const bench = common.createBenchmark(main, {

benchmark/streams/iter/throughput-pipeto.js renamed to benchmark/streams/iter-throughput-pipeto.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Measures pure pipe throughput without consumer-side collection overhead.
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const { Readable, Writable, pipeline } = require('stream');
77

88
const bench = common.createBenchmark(main, {

benchmark/streams/iter/throughput-transform.js renamed to benchmark/streams/iter-throughput-transform.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Uses byte-level ASCII uppercase (branchless, no encoding dependency).
33
'use strict';
44

5-
const common = require('../../common.js');
5+
const common = require('../common.js');
66
const { Readable, Transform, Writable, pipeline } = require('stream');
77

88
const bench = common.createBenchmark(main, {

test/parallel/test-stream-iter-cross-realm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ async function testFromSyncCrossRealmInt32Array() {
124124
const crossRealm = vm.runInNewContext('new Int32Array([1])');
125125
const readable = fromSync(crossRealm);
126126
const data = bytesSync(readable);
127-
// Int32Array([1]) = 4 bytes: 01 00 00 00 (little-endian)
127+
// Int32Array([1]) = 4 bytes, endianness varies by platform
128128
assert.strictEqual(data.length, 4);
129-
assert.strictEqual(data[0], 1);
129+
assert.strictEqual(new Int32Array(data.buffer, data.byteOffset, 1)[0], 1);
130130
}
131131

132132
Promise.all([

0 commit comments

Comments
 (0)