Skip to content

Commit

Permalink
Move benchmarks off removed node-pty apis
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Oct 2, 2023
1 parent a673b11 commit f6c4aee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ perfContext('Terminal: sh -c "dd if=/dev/urandom count=40 bs=1k | hexdump | lolc
});
const chunks: Buffer[] = [];
let length = 0;
p.on('data', data => {
p.onData(data => {
chunks.push(data as unknown as Buffer);
length += data.length;
});
await new Promise<void>(resolve => p.on('exit', () => resolve()));
await new Promise<void>(resolve => p.onExit(() => resolve()));
contentUtf8 = Buffer.concat(chunks, length);
// translate to content string
const buffer = new Uint32Array(contentUtf8.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ perfContext('Terminal: ls -lR /usr/lib', () => {
});
const chunks: Buffer[] = [];
let length = 0;
p.on('data', data => {
p.onData(data => {
chunks.push(data as unknown as Buffer);
length += data.length;
});
await new Promise<void>(resolve => p.on('exit', () => resolve()));
await new Promise<void>(resolve => p.onExit(() => resolve()));
contentUtf8 = Buffer.concat(chunks, length);
// translate to content string
const buffer = new Uint32Array(contentUtf8.length);
Expand Down
4 changes: 2 additions & 2 deletions test/benchmark/Terminal.benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ perfContext('Terminal: ls -lR /usr/lib', () => {
});
const chunks: Buffer[] = [];
let length = 0;
p.on('data', data => {
p.onData(data => {
chunks.push(data as unknown as Buffer);
length += data.length;
});
await new Promise<void>(resolve => p.on('exit', () => resolve()));
await new Promise<void>(resolve => p.onExit(() => resolve()));
contentUtf8 = Buffer.concat(chunks, length);
// translate to content string
const buffer = new Uint32Array(contentUtf8.length);
Expand Down

0 comments on commit f6c4aee

Please sign in to comment.