Skip to content

Commit

Permalink
fix: runsFactor in benchmark (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuyennhv committed Oct 31, 2023
1 parent a2981f9 commit aa208c2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/benchmark/protobuf.test.ts
Expand Up @@ -27,21 +27,25 @@ describe('protobuf', function () {

const bytes = RPC.encode(rpc).finish()

// console.log('@@@ encoded to', Buffer.from(bytes.slice()).toString('hex'), 'length', bytes.length)
const runsFactor = 1000

itBench({
id: 'decode Attestation message using protobufjs',
fn: () => {
RPC.decode(bytes)
for (let i = 0; i < runsFactor; i++) {
RPC.decode(bytes)
}
},
runsFactor: 100
runsFactor
})

itBench({
id: 'encode Attestation message using protobufjs',
fn: () => {
RPC.encode(rpc).finish()
for (let i = 0; i < runsFactor; i++) {
RPC.encode(rpc).finish()
}
},
runsFactor: 100
runsFactor
})
})

0 comments on commit aa208c2

Please sign in to comment.