First, I'd like to thank Raphael for his great work on the ES5 implementation, and to Norris for his mentoring. This is incredibly useful work, and I agree with your approach of putting completeness and correctness over performance.
I've been working on a Rhino wrapper for Berkeley DB that uses JSON as data format, and I wanted to know how fast the JSON parser could get. Since JSON is such a simple format, I decided to try rewriting the JSON parser by hand, and it turned out indeed quite a bit faster. I filed a new bug with the patch: https://bug509678.bugzilla.mozilla.org/attachment.cgi?id=393739 Performance should now be close to tracemonkey and V8. With the - server JVM I get even faster than my Firefox 3.5.2 (I don't have recent spider/tracemonkey/V8 builds with native JSON support for testing). In the context of my Berkeley DB wrapper, running a query that returns a few thousand objects now takes ~80 millis for just the ids (no JSON parsing involved) against ~120 millis for the full, JSON-parsed objects. I just scrapped my plans for caching of parsed objects - JSON isn't the bottleneck anymore. Hannes On Aug 10, 8:33 pm, Joran <[email protected]> wrote: > Thanks Norris, I would help if I could, unfortunately my knowledge of > Java is limited to scripting from Javascript! Poor indeed. > > But perhaps this could help, from the V8 discussion on similar JSON > performance issues: > > "Rather than hacking some basic JSON support into V8 or your V8 > application, I recommend that it be done ... using Ragel: > http://www.complang.org/ragel/ > > Ragel's compiled state machines are blindingly fast, and hence so are > the implementations of JSON of languages that use it: > http://json.rubyforge.org/ > http://modules.gotpike.org/module_info.html?module_id=43 > > I did some elementary benchmarking of JSON implementations a while > back, and JSON in Ragel was in a class of its own." > > Excerpt > from:http://www.mail-archive.com:80/[email protected]/msg00243.html _______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
