Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

XS code is almost always buggy (and the bugs are a huge pain in being very "weird" and tending to be huge consumers of a developer's time). JSON::PP uses an algorithm that is efficient in C but is especially slow in Perl. You might have the best luck with some other non-XS implementation. Try JSON::Tiny or some other JSON module.

It should be fairly easy to efficiently parse JSON in Perl, but there are also some typical traps to avoid so many JSON parsing approaches in Perl will be less efficient, so let us know how efficient are the modules that you try.

It is too bad that the author of JSON::XS didn't know that one should thoroughly avoid manipulating Perl data structures from XS code. Creating Perl data structures in XS code is an even worse idea. But this is a case where it actually would be quite hard to do the parsing in XS while creating the Perl data structures in Perl.

But I (wrongly) recall looking at the code and thinking that the creation of the 'true' and 'false' values should've been done in Perl. I guess my instincts were right about that, even though we haven't noticed this problem (also common for XS bugs).

- tye        


In reply to Re: JSON::XS Bool issue in mod_perl (XS--) by tye
in thread JSON::XS Bool issue in mod_perl by allyc

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-03-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found