Skip to content

Commit 9548316

Browse files
committed
test(bench): add typed array benchmark tests
1 parent 1478144 commit 9548316

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bench/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ try {
3838
} catch (error) {
3939
console.error('cannot benchmark generator functions');
4040
}
41+
[
42+
'Float64Array', 'Float32Array',
43+
'Uint32Array', 'Uint16Array', 'Uint8Array',
44+
'Int32Array', 'Int16Array', 'Int8Array',
45+
'Uint8ClampedArray',
46+
].forEach(function (value) {
47+
if (typeof global[value] === 'function') {
48+
fixtures[value + new Array(19 - value.length).join(' ')] = new (global[value])(1);
49+
}
50+
});
51+
if (typeof DataView === 'function') {
52+
fixtures['DataView '] = new DataView(new ArrayBuffer(1));
53+
}
4154

4255
var filter = process.argv[2] || '';
4356
Object.keys(fixtures).filter(function (key) {

0 commit comments

Comments
 (0)