Loading ...
Sorry, an error occurred while loading the content.

676Re: [json] Re: JSON vs XML

Expand Messages
  • Tom Metro
    Jan 17, 2007
    • 0 Attachment
      shijupc123 wrote:
      > genzoeri wrote:
      >> ...know that json is faster than xml. I want to know if anybody have the
      >> testing script or algorithm how to prove this issue?
      >
      > It is nothing but AJAX.
      > [...an explanation (of sorts) of AJAX omitted...]
      > This is the real power behind Ajax.

      Remember that the X in AJAX stands for XML, so XML can also be used in
      the same way you described to avoid reloading web pages. The original
      poster wasn't asking about traditional form submission vs. AJAX.

      The question was JSON vs. XML, and the theoretical performance advantage
      to JSON (as probably explained in the article) is that the browser
      incorporates a compiled (fast) JavaScript parser, which can handle the
      JSON data directly, and eliminates the need of writing an XML parser in
      an interpreted language. There may also be some advantages to JSON's
      more compact data format.

      However, I believe most modern browsers now have the ability to parse
      XML and provide a DOM API for accessing data stored within an XML
      sub-tree. I'm not aware of any performance comparison code, but you'd be
      better off coding something yourself that reflected your usage scenario,
      and as importantly, took advantage of the particular web browser clients
      you were targeting, as capabilities and performance will vary.

      -Tom

      --
      Tom Metro
      Venture Logic, Newton, MA, USA
      "Enterprise solutions through open source."
      Professional Profile: http://tmetro.venturelogic.com/
    • Show all 14 messages in this topic