Skip to content

Commit f94efd2

Browse files
committed
cleanup hermes benchamrk too
1 parent 3031272 commit f94efd2

File tree

7 files changed

+26
-26
lines changed

7 files changed

+26
-26
lines changed

benchmark/grapheme/perf-hermes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ for (let lib of libs) {
4646
});
4747
}
4848

49-
console.log('\nExecuting Hermes bytecodes...\n');
49+
console.log('\nExecuting Hermes benchmark...\n');
5050

5151
for (let bench of benches) {
52+
console.log(`--- ${bench.libName} ---\n`);
5253
await $({ stdio: 'inherit' })`hermes ${bench.hermesBin}`;
53-
console.log();
5454
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import { Segmenter } from '@formatjs/intl-segmenter/src/segmenter.js';
21
import { inputs, simpleBench } from '../../_simple-bench.js';
32

4-
const segmenter = new Segmenter();
3+
import { Segmenter } from '../bundle-entries/formatjs-intl-segmenter.js';
4+
let segmenter = new Segmenter();
55

66
{
7-
const result = simpleBench(1000, () => {
7+
let result = simpleBench(1000, () => {
88
void [...segmenter.segment(inputs.small)];
99
});
1010

1111
print(`@formatjs/intl-segmenter (small input)`);
1212
print(`samples: ${result.samples}`);
1313
print(`duration (avg): ${result.avgDuration}`);
14+
print();
1415
}
1516

16-
1717
{
18-
const result = simpleBench(1000, () => {
18+
let result = simpleBench(1000, () => {
1919
void [...segmenter.segment(inputs.medium)];
2020
});
2121

22-
print();
2322
print(`@formatjs/intl-segmenter (medium input)`);
2423
print(`samples: ${result.samples}`);
2524
print(`duration (avg): ${result.avgDuration}`);
25+
print();
2626
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import GraphemeSplitter from 'grapheme-splitter';
21
import { inputs, simpleBench } from '../../_simple-bench.js';
32

4-
const graphemeSplitter = new (GraphemeSplitter.default || GraphemeSplitter)();
3+
import { GraphemeSplitter } from '../bundle-entries/grapheme-splitter.js';
4+
let graphemeSplitter = new (GraphemeSplitter.default || GraphemeSplitter)();
55

66
{
7-
const result = simpleBench(1000, () => {
7+
let result = simpleBench(1000, () => {
88
void [...graphemeSplitter.iterateGraphemes(inputs.small)];
99
});
1010

1111
print(`grapheme-splitter (small input)`);
1212
print(`samples: ${result.samples}`);
1313
print(`duration (avg): ${result.avgDuration}`);
14+
print();
1415
}
1516

16-
1717
{
18-
const result = simpleBench(1000, () => {
18+
let result = simpleBench(1000, () => {
1919
void [...graphemeSplitter.iterateGraphemes(inputs.medium)];
2020
});
2121

22-
print();
2322
print(`grapheme-splitter (medium input)`);
2423
print(`samples: ${result.samples}`);
2524
print(`duration (avg): ${result.avgDuration}`);
25+
print();
2626
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import Graphemer from 'graphemer';
21
import { inputs, simpleBench } from '../../_simple-bench.js';
32

4-
const graphemer = new (Graphemer.default || Graphemer)();
3+
import { Graphemer } from '../bundle-entries/graphemer.js';
4+
let graphemer = new (Graphemer.default || Graphemer)();
55

66
{
7-
const result = simpleBench(1000, () => {
7+
let result = simpleBench(1000, () => {
88
void [...graphemer.iterateGraphemes(inputs.small)];
99
});
1010

1111
print(`graphemer (small input)`);
1212
print(`samples: ${result.samples}`);
1313
print(`duration (avg): ${result.avgDuration}`);
14+
print();
1415
}
1516

1617

1718
{
18-
const result = simpleBench(1000, () => {
19+
let result = simpleBench(1000, () => {
1920
void [...graphemer.iterateGraphemes(inputs.medium)];
2021
});
2122

22-
print();
2323
print(`graphemer (medium input)`);
2424
print(`samples: ${result.samples}`);
2525
print(`duration (avg): ${result.avgDuration}`);
26+
print();
2627
}
27-
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
import { graphemeSegments } from '../../../src/grapheme.js';
21
import { inputs, simpleBench } from '../../_simple-bench.js';
32

3+
import { graphemeSegments } from '../bundle-entries/unicode-segmenter.js';
4+
45
{
5-
const result = simpleBench(1000, () => {
6+
let result = simpleBench(1000, () => {
67
void [...graphemeSegments(inputs.small)];
78
});
89

910
print(`unicode-segmenter/grapheme (small input)`);
1011
print(`samples: ${result.samples}`);
1112
print(`duration (avg): ${result.avgDuration}`);
13+
print();
1214
}
1315

1416
{
15-
const result = simpleBench(1000, () => {
17+
let result = simpleBench(1000, () => {
1618
void [...graphemeSegments(inputs.medium)];
1719
});
1820

19-
print();
2021
print(`unicode-segmenter/grapheme (medium input)`);
2122
print(`samples: ${result.samples}`);
2223
print(`medium input (avg): ${result.avgDuration}`);
24+
print();
2325
}

benchmark/grapheme/perf-quickjs/grapheme-splitter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { inputs, simpleBench } from '../../_simple-bench.js';
22

33
import { GraphemeSplitter } from '../bundle-entries/grapheme-splitter.bundle.js';
4-
54
let graphemeSplitter = new (GraphemeSplitter.default || GraphemeSplitter)();
65

76
{

benchmark/grapheme/perf-quickjs/graphemer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { inputs, simpleBench } from '../../_simple-bench.js';
22

33
import { Graphemer } from '../bundle-entries/graphemer.bundle.js';
4-
54
let graphemer = new (Graphemer.default || Graphemer)();
65

76
{

0 commit comments

Comments
 (0)