Skip to content

Comment on JQuery 1.4 and Malformed JSONparent

Comments

Test case: http://ejohn.org/files/json-parse/

  Firefox 3.5: eval: 549 JSON.parse: 490
  Safari 4: eval: 246 JSON.parse: 215
  IE 8: eval: 1438 JSON.parse: 1031
  Chrome: eval: 241 JSON.parse: 656
So yeah, a bit faster in Firefox and Safari, much much faster in IE 8 (the one that matters), and oddly slower in Chrome. I'll go out on a limb and blame their lax parsing (they support malformed strings).

In the end though the parsing is a distant second to the improved security: Guaranteeing that eval will never get touched in modern browsers is a huge win from a framework perspective.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.