Skip to content

Commit 389e650

Browse files
committed
docs: add @aws-sdk/querystring-parser to benchmarks
1 parent b01ec9c commit 389e650

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ console.log(qs.stringify({ foo: ['bar', 'baz'] }))
4848
╔═════════════════════════════════════════╤═════════╤═══════════════════╤═══════════╗
4949
║ Slower tests │ Samples │ Result │ Tolerance ║
5050
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
51-
║ qs │ 10000 │ 319951.57 op/sec │ ± 1.07 % ║
52-
║ query-string │ 10000 │ 333653.03 op/sec │ ± 1.22 % ║
53-
║ querystringify │ 10000 │ 431400.52 op/sec │ ± 1.72 % ║
54-
║ URLSearchParams-with-Object.fromEntries │ 10000 │ 884654.19 op/sec │ ± 1.50 % ║
55-
║ URLSearchParams-with-construct │ 10000 │ 1184144.96 op/sec │ ± 3.33 % ║
56-
║ node:querystring │ 2500 │ 1413741.68 op/sec │ ± 0.90 % ║
51+
║ qs │ 9000 │ 320475.01 op/sec │ ± 1.00 % ║
52+
║ query-string │ 10000 │ 329524.10 op/sec │ ± 1.33 % ║
53+
║ querystringify │ 1000 │ 447654.63 op/sec │ ± 0.64 % ║
54+
║ @aws-sdk/querystring-parser │ 1000 │ 467889.89 op/sec │ ± 0.75 % ║
55+
║ URLSearchParams-with-Object.fromEntries │ 10000 │ 836523.77 op/sec │ ± 3.43 % ║
56+
║ URLSearchParams-with-construct │ 10000 │ 1239361.94 op/sec │ ± 2.88 % ║
57+
║ node:querystring │ 10000 │ 1399756.44 op/sec │ ± 4.07 % ║
5758
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
5859
║ Fastest test │ Samples │ Result │ Tolerance ║
5960
╟─────────────────────────────────────────┼─────────┼───────────────────┼───────────╢
60-
║ fast-querystring │ 10000 │ 1503424.80 op/sec │ ± 3.25 % ║
61+
║ fast-querystring │ 5500 │ 1496630.81 op/sec │ ± 0.98 % ║
6162
╚═════════════════════════════════════════╧═════════╧═══════════════════╧═══════════╝
6263
```
6364

benchmark/parse.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import fastQueryString from "../lib/index.js";
44
import native from "node:querystring";
55
import queryString from "query-string";
66
import querystringify from "querystringify";
7+
import awsQueryStringParser from "@aws-sdk/querystring-parser";
78

89
await benchmark(
910
{
@@ -54,6 +55,11 @@ await benchmark(
5455
"frappucino=muffin&goat=scone&pond=moose&foo=bar&foo=baz",
5556
);
5657
},
58+
'@aws-sdk/querystring-parser'() {
59+
return awsQueryStringParser.parseQueryString(
60+
"frappucino=muffin&goat=scone&pond=moose&foo=bar&foo=baz",
61+
);
62+
},
5763
},
5864
{ warmup: true },
5965
);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"author": "Yagiz Nizipli <yagiz@nizipli.com>",
2525
"license": "MIT",
2626
"devDependencies": {
27+
"@aws-sdk/querystring-parser": "^3.162.0",
2728
"@types/node": "^18.7.15",
2829
"cronometro": "^1.1.2",
2930
"qs": "^6.11.0",

pnpm-lock.yaml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)