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

comment on

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

I hate to disappoint you but Java is pretty fast nowadays. Many clever optimizations have improved the performance of the Java Virtual Machine. Although startup is typically slower than other languages and Java programs tend to be more memory hungry many benchmarks show that for many types of tasks the performance is close to that of C++. So although you can optimize/improve your perl script, in ways others have suggested, I doubt you can really beat the Java implementation in terms of execution speed. Also, it's not unthinkable your java program can't be optimized. If you really want speed C is probably the best choice (unless you like assembler;). I typically use Perl to prototype solutions because I can do that (much) faster compared to other languages. Normally I re-implement in Java and when speed is essential in C.

Cheers

Harry

PS I'm working on CSP's and looking into Genetic Algorithms for solving them, well, approaching a decent solution in less time than other algorithms take. I know of several open source Java implementations, I wonder why you wrote it yourself? Would you care to share your code?


In reply to Re: Perl slower than java by dHarry
in thread Perl slower than java by Christian888

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 perusing the Monastery: (6)
As of 2024-04-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found