You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are absolutely right. I did a benchmark and it seems regex is 80% slower. I would appreciate if you can open a pull request to change this!
Number.isNaN vs isNaN
I believe Number.isNaN is slower than isNaN, due to the type check. A quick benchmark showed that Number.isNaN is 0.17% slower on Safari, and 0.01% slower on Chrome. I think it's negligible in terms of performance. Therefore, would you open a pull request for this?
@anonrig
fast-querystring/lib/parse.js
Lines 44 to 45 in 212c51c
.replaceAll('+', ' ')
is probably faster than the regex variant.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll
fast-querystring/lib/parse.js
Line 27 in 212c51c
Number.isNaN()
is more robusthttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN
The text was updated successfully, but these errors were encountered: