MCPcopy Create free account
hub / github.com/avoidwork/tenso / benchmarkFormParser

Function benchmarkFormParser

benchmarks/parsers.js:133–157  ·  view source on GitHub ↗

* Benchmarks form URL encoded parser performance

()

Source from the content-addressed store, hash-verified

131 * Benchmarks form URL encoded parser performance
132 */
133function benchmarkFormParser () {
134 console.log("\n📊 Form URL Encoded Parser Benchmarks");
135 console.log("-".repeat(40));
136
137 const suite = new Benchmark.Suite();
138 const formParser = parsers.get("application/x-www-form-urlencoded");
139
140 suite
141 .add("Form Parser - Small (2 fields)", () => {
142 formParser(testData.form.small);
143 })
144 .add("Form Parser - Medium (100 fields)", () => {
145 formParser(testData.form.medium);
146 })
147 .add("Form Parser - Large (600 fields)", () => {
148 formParser(testData.form.large);
149 })
150 .on("cycle", event => {
151 console.log(` ${String(event.target)}`);
152 })
153 .on("complete", function () {
154 console.log(` Fastest: ${this.filter("fastest").map("name")}`);
155 })
156 .run();
157}
158
159/**
160 * Comparative parser benchmarks

Callers 1

mainFunction · 0.85

Calls 2

formParserFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected