Commit 85a92a37 authored by Brian White's avatar Brian White
Browse files

querystring: optimize parse and stringify

parse optimizations:

* Move try-catch to separate function to keep entire function from
being deoptimized.
* Use key array lookup instead of using hasOwnProperty.
* Avoid decoding known empty strings.
* Avoid possibly unnecessary switch to slower decoder for values if
key decoding throws.

stringify optimizations:

* Use manual loop for default encoder instead of encodeURIComponent.
* Use string concatenation instead of joining an array of strings.
* Avoid caching result of typeof.

PR-URL: https://github.com/iojs/io.js/pull/847


Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent 65d0a8ec
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment