mirror of
https://github.com/darksaid98/mediaplex.git
synced 2026-12-02 06:28:51 +00:00
chore: update benchmark with real sample
This commit is contained in:
1 parent
e34aedde25
commit
aadd415d6a
8 files changed
+73
-82
No files matched your search
+12
-7
@@ -7,7 +7,8 @@ import {
|
||||
createOpusScriptWasmEncoder,
|
||||
generatePCMSample,
|
||||
createEvanOpusEncoder,
|
||||
createEvanOpusEncoderWasm
|
||||
createEvanOpusEncoderWasm,
|
||||
createSimdEvanOpusEncoder
|
||||
} from './common.mjs';
|
||||
|
||||
const config = {
|
||||
@@ -22,6 +23,7 @@ const wasmEncoder = createOpusScriptWasmEncoder(config);
|
||||
const asmEncoder = createOpusScriptAsmEncoder(config);
|
||||
const evanOpus = createEvanOpusEncoder(config);
|
||||
const evanOpusWasm = createEvanOpusEncoderWasm(config);
|
||||
const evanWasmOpus = createSimdEvanOpusEncoder(config);
|
||||
|
||||
const SAMPLE = generatePCMSample(config.FRAME_SIZE * config.CHANNELS * 6);
|
||||
|
||||
@@ -32,18 +34,21 @@ mitata.group('OpusEncoder', () => {
|
||||
mitata.bench('@discordjs/opus', () => {
|
||||
nativeEncoder.encode(SAMPLE);
|
||||
});
|
||||
mitata.bench('@evan/opus', () => {
|
||||
evanOpus.encode(SAMPLE);
|
||||
});
|
||||
mitata.bench('@evan/opus (wasm)', () => {
|
||||
evanOpusWasm.encode(SAMPLE);
|
||||
});
|
||||
mitata.bench('opusscript', () => {
|
||||
wasmEncoder.encode(SAMPLE, config.FRAME_SIZE);
|
||||
});
|
||||
mitata.bench('opusscript (no wasm)', () => {
|
||||
asmEncoder.encode(SAMPLE, config.FRAME_SIZE);
|
||||
});
|
||||
mitata.bench('@evan/opus', () => {
|
||||
evanOpus.encode(SAMPLE);
|
||||
});
|
||||
mitata.bench('@evan/opus (wasm)', () => {
|
||||
evanOpusWasm.encode(SAMPLE);
|
||||
});
|
||||
mitata.bench('@evan/wasm', () => {
|
||||
evanWasmOpus.encode(SAMPLE);
|
||||
});
|
||||
});
|
||||
|
||||
await mitata.run();
|
||||
Reference in new issue
Block a user