Skip to content

Commit

Permalink
perf: add benchmarks for importing all packages
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Oct 3, 2022
1 parent 2a8f373 commit 65ae8e1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
28 changes: 28 additions & 0 deletions benchmark/import.mjs
@@ -0,0 +1,28 @@
import benchmark from "cronometro";

await benchmark(
{
qs() {
return import('qs')
},
"fast-querystring"() {
return import('../lib/index.js')
},
"node:querystring"() {
return import('node:querystring')
},
"query-string"() {
return import('query-string')
},
querystringify() {
return import('querystringify')
},
"@aws-sdk/querystring-parser"() {
return import('@aws-sdk/querystring-parser')
},
querystringparser() {
return import('querystringparser')
},
},
{ warmup: true },
);
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -13,7 +13,8 @@
"test:coverage": "vitest --coverage",
"coverage": "vitest run --coverage",
"benchmark:parse": "node benchmark/parse.mjs",
"benchmark:stringify": "node benchmark/stringify.mjs"
"benchmark:stringify": "node benchmark/stringify.mjs",
"benchmark:import": "node benchmark/import.mjs"
},
"keywords": [
"querystring",
Expand Down

0 comments on commit 65ae8e1

Please sign in to comment.