Q3) Does Data::Roundtrip cover the same ground that JSON::XS did? I can't disambiguate what XS means.

Data::Roundtrip requires the JSON distribution. When used, the JSON module will load JSON::XS if it is available to your interpreter, and the pure perl JSON::PP if not. JSON::PP has been in core since ~5.14, so this functionality is very handy instead of just having your script fall over if JSON::XS isn't installed.

XS simply means that there are components to the software that are compiled, therefore in most cases making much of its functionality much, much faster.

One of my distributions, Bit::Manip is an XS based module, but I also have a pure perl version (Bit::Manip::PP) for those who can't or don't want to compile software. Here's a benchmark script between the two, and the results. The C/XS version is ~394% faster than the pure perl version:

use warnings; use strict; # performs a benchmark between this XS # version and the PP version use Benchmark qw(timethese cmpthese); use Bit::Manip; use Bit::Manip::PP; my $do = $ARGV[0]; timethese(1000000, { 'c' => 'c', 'p' => 'p', } ); cmpthese(1000000, { 'c' => 'c', 'p' => 'p', } ); sub c { Bit::Manip::bit_set(65535, 0, 8, 0xFF); } sub p { Bit::Manip::PP::bit_set(65535, 0, 8, 0xFF); } __END__ Benchmark: timing 1000000 iterations of c, p... c: 3 wallclock secs ( 3.35 usr + 0.00 sys = 3.35 CPU) @ 29 +8507.46/s (n=1000000) p: 17 wallclock secs (16.58 usr + 0.00 sys = 16.58 CPU) @ 60 +313.63/s (n=1000000) Rate p c p 60606/s -- -80% c 299401/s 394% --

In reply to Re^6: a *working* JSON module (Perl's Debugger), related issues by stevieb
in thread Can someone please write a *working* JSON module by cnd

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.