forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
querystring: improve unescapeBuffer performance
PR-URL: nodejs#10837 Reviewed-By: James M Snell <[email protected]>
- Loading branch information
1 parent
f4796d5
commit 97ff432
Showing
3 changed files
with
65 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
var common = require('../common.js'); | ||
var querystring = require('querystring'); | ||
|
||
var bench = common.createBenchmark(main, { | ||
input: [ | ||
'there is nothing to unescape here', | ||
'there%20are%20several%20spaces%20that%20need%20to%20be%20unescaped', | ||
'there%2Qare%0-fake%escaped values in%%%%this%9Hstring', | ||
'%20%21%22%23%24%25%26%27%28%29%2A%2B%2C%2D%2E%2F%30%31%32%33%34%35%36%37' | ||
], | ||
n: [10e6], | ||
}); | ||
|
||
function main(conf) { | ||
var input = conf.input; | ||
var n = conf.n | 0; | ||
|
||
bench.start(); | ||
for (var i = 0; i < n; i += 1) | ||
querystring.unescapeBuffer(input); | ||
bench.end(n); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters