diff --git a/packages/benchmarks/bench-utf8.ts b/packages/benchmarks/bench-utf8.ts index 0a8193a7..75debca6 100644 --- a/packages/benchmarks/bench-utf8.ts +++ b/packages/benchmarks/bench-utf8.ts @@ -59,6 +59,12 @@ for (let i = 3; i <= 14; i++) { for (let fix of fixtures) { console.log(`### ${fix.characters} characters`); - bench('@protobufjs/utf8 ', () => protobufJsDecode(protobufJsEncode(fix.text))); - bench('native ', () => nativeDecode(nativeEncode(fix.text))); + const bytes = nativeEncode(fix.text); + bench('decode @protobufjs/utf8 ', () => protobufJsDecode(bytes)); + bench('decode native ', () => nativeDecode(bytes)); +} +for (let fix of fixtures) { + console.log(`### ${fix.characters} characters`); + bench('encode @protobufjs/utf8 ', () => protobufJsEncode(fix.text)); + bench('encode native ', () => nativeEncode(fix.text)); }