Skip to content

Commit ce732de

Browse files
committed
docs: add http-querystring-stringify to benchmarks
1 parent 389e650 commit ce732de

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,18 @@ console.log(qs.stringify({ foo: ['bar', 'baz'] }))
6767
```
6868
> node benchmark/stringify.mjs
6969
70-
╔══════════════════╤═════════╤═══════════════════╤═══════════╗
71-
║ Slower tests │ Samples │ Result │ Tolerance ║
72-
╟──────────────────┼─────────┼───────────────────┼───────────╢
73-
║ query-string │ 10000 │ 294312.93 op/sec │ ± 1.31 % ║
74-
║ qs │ 10000 │ 355420.44 op/sec │ ± 1.26 % ║
75-
║ URLSearchParams │ 10000 │ 594915.18 op/sec │ ± 1.47 % ║
76-
║ querystringify │ 10000 │ 785004.65 op/sec │ ± 2.09 % ║
77-
║ node:querystring │ 1500 │ 1864502.85 op/sec │ ± 0.85 % ║
78-
╟──────────────────┼─────────┼───────────────────┼───────────╢
79-
║ Fastest test │ Samples │ Result │ Tolerance ║
80-
╟──────────────────┼─────────┼───────────────────┼───────────╢
81-
║ fast-querystring │ 10000 │ 1893015.11 op/sec │ ± 4.26 % ║
82-
╚══════════════════╧═════════╧═══════════════════╧═══════════╝
70+
╔════════════════════════════╤═════════╤═══════════════════╤═══════════╗
71+
║ Slower tests │ Samples │ Result │ Tolerance ║
72+
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
73+
║ query-string │ 10000 │ 290850.12 op/sec │ ± 1.52 % ║
74+
║ qs │ 10000 │ 324324.45 op/sec │ ± 2.05 % ║
75+
║ http-querystring-stringify │ 10000 │ 481327.85 op/sec │ ± 1.77 % ║
76+
║ URLSearchParams │ 10000 │ 538867.84 op/sec │ ± 3.93 % ║
77+
║ querystringify │ 10000 │ 774992.18 op/sec │ ± 2.51 % ║
78+
║ node:querystring │ 10000 │ 1827458.66 op/sec │ ± 5.41 % ║
79+
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
80+
║ Fastest test │ Samples │ Result │ Tolerance ║
81+
╟────────────────────────────┼─────────┼───────────────────┼───────────╢
82+
║ fast-querystring │ 10000 │ 1881474.27 op/sec │ ± 4.78 % ║
83+
╚════════════════════════════╧═════════╧═══════════════════╧═══════════╝
8384
```

benchmark/parse.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ await benchmark(
5555
"frappucino=muffin&goat=scone&pond=moose&foo=bar&foo=baz",
5656
);
5757
},
58-
'@aws-sdk/querystring-parser'() {
58+
"@aws-sdk/querystring-parser"() {
5959
return awsQueryStringParser.parseQueryString(
6060
"frappucino=muffin&goat=scone&pond=moose&foo=bar&foo=baz",
6161
);

benchmark/stringify.mjs

Lines changed: 4 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 httpQuerystringStringify from "http-querystring-stringify";
78

89
const value = {
910
frappucino: "muffin",
@@ -36,6 +37,9 @@ await benchmark(
3637
querystringify() {
3738
return querystringify.stringify(value);
3839
},
40+
"http-querystring-stringify"() {
41+
return httpQuerystringStringify(value);
42+
},
3943
},
4044
{ warmup: true },
4145
);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@aws-sdk/querystring-parser": "^3.162.0",
2828
"@types/node": "^18.7.15",
2929
"cronometro": "^1.1.2",
30+
"http-querystring-stringify": "^2.1.0",
3031
"qs": "^6.11.0",
3132
"query-string": "^7.1.1",
3233
"querystringify": "^2.2.0",

pnpm-lock.yaml

Lines changed: 6 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)