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
650kb. I've been running the functions about 20 times at a time on
each platform, a couple of times each over the last week, on a MacBook
Pro, and have found the following consistent 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