Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Improve processing time for string substitutions

by Krambambuli (Curate)
on Apr 16, 2007 at 14:35 UTC ( [id://610361]=note: print w/replies, xml ) Need Help??


in reply to Improve processing time for string substitutions

I'm having difficulties in understanding the exact form of the entities - is it just my browser/setup or is something wrong with the formatting ?

I'd be anxious to know what Benchmark would show about the various speedup suggestions.

If it would be true that the entities content might be separated by successively splitting on '>' and then on '<', replacing the content from the hash and re-joining the modified parts might even beat the regexp-based approach.

Curious.
  • Comment on Re: Improve processing time for string substitutions

Replies are listed 'Best First'.
Re^2: Improve processing time for string substitutions
by jhourcle (Prior) on Apr 16, 2007 at 17:40 UTC

    It's unescaped HTML entities:

    I want to convert the entities like &ge, &le, into hexa values &#x2265, &#x2264.

    But, I'll also point out that the actual entity should end in a semicolon. (which prevents issues such as '&or;' matching '&ordf;')

      Well then, it's something like below that might fit.

      The results are interesting:
      Benchmark: timing 1000 iterations of regexish, with_splitting... regexish: 59 wallclock secs (58.16 usr + 0.02 sys = 58.18 CPU) @ 17 +.19/s (n=1000) with_splitting: 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU) +@ 50000.00/s (n=1000) (warning: too few iterations for a reliable count)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://610361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found