Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Perl slower than javaby dHarry (Abbot) |
on Dec 09, 2010 at 11:09 UTC ( [id://876235]=note: 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 Section
Seekers of Perl Wisdom
|
|