* Benchmarks form URL encoded parser performance
()
| 131 | * Benchmarks form URL encoded parser performance |
| 132 | */ |
| 133 | function 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 |
no test coverage detected