STV!
http://codereview.chromium.org/5567005/diff/1/src/json.js File src/json.js (right): http://codereview.chromium.org/5567005/diff/1/src/json.js#newcode213 src/json.js:213: if (builder.pop() != ",") { This seems a bit indirect. I think it would be clearer to just say if (len == 0). Is this version faster? http://codereview.chromium.org/5567005/diff/1/src/json.js#newcode229 src/json.js:229: builder.push(%QuoteJSONString(p), ":"); If you didn't already try it I think it would be interesting to experiment with having QuoteJSONString not add the quotes. We should be faster at adding the quotes now and it would open up the possibility of just returning the string unchanged which should be the common case. We can save that for another change though. http://codereview.chromium.org/5567005/diff/1/src/json.js#newcode241 src/json.js:241: if (builder.pop() != ",") { Again, I find this convoluted. A boolean variable that gets set if the for loop is non-empty would be clearer. http://codereview.chromium.org/5567005/diff/1/src/json.js#newcode258 src/json.js:258: builder.push(($isFinite(value) ? $String(value) : "null")); I wonder how $String compares speedwise to ("" + value). http://codereview.chromium.org/5567005/diff/1/src/json.js#newcode270 src/json.js:270: } else { // Regular non-wrapped object There should be 2 spaces before // http://codereview.chromium.org/5567005/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
