Hi Raphael,

Since the announcement of the new native JSON object for Rhino, I've
done some naïve testing on Rhino, TraceMonkey and V8, using two simple
functions:

var testparse = function(string) { var start = new Date.getTime();
JSON.parse(string); return new Date.getTime() - start; }
var teststringify = function(object) { var start = new Date.getTime();
JSON.stringify(object); return new Date.getTime() - start; }

For "object", I used an array of 2082 objects. For "string", I used
the JSON representation of "object". The length of "string" is about
640kb.

I ran the functions about 20 times on each platform, on a MacBook Pro,
and found the following rough averages:

JSON.parse:
Rhino: 640ms
TraceMonkey: 44ms
V8: 27ms

JSON.stringify:
Rhino: 140ms
V8: 70ms
TraceMonkey: 44ms

Is my method okay? Are these results to be expected?
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to