Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
This doesn't surprise me in the least. Seeing a speedup of a factor of 200 or so isn't unusual when turning an algorithm from perl to C. Like it or not, perl has a fair number of inefficiencies built into it, and some of the things it requires to happen, like operator overloading and proper tie behaviour, have unavoidable overhead.

C's a lot more limited, and as such can make more assumptions at compile time, which can generate better code, and that's just fine. (Plus, of course, there's been far more work on any C compiler's optimizer than on perl's optimizer, which can make a pretty darned big difference)

Really does look like you did the appropriate thing--used perl for a fast knock-together project, and moved to a faster language when it turned out to be necessary. FWIW, I don't think you'd have seen much, if any, speed win from going with Java. The cost of moving to Java from perl would've been about the same as moving to C, and C's definitely much faster than Java...


In reply to Re: Confirming what we already knew by Elian
in thread Confirming what we already knew by AssFace

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 romping around the Monastery: (1)
As of 2024-04-25 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found