Hi perl_devel
You may find that it takes a bit longe while to run the Perl with Inline::Java, than it takes to run the Java code with the JVM. The reason for this is because Inline::Java takes your code: creates an appropriatly name java source file, compiles it, imbedds it, runs it and makes whatever calls it needs to make.
This is slower because Inline::Java has a bridge that acts like a go-between for Perl and Java. So the Java code is running at normal speed, and the perl is running at normal speed. The hit comes in when the Perl code has to wait for the Java code:D
Kristofer Hoch | [reply] |
This is probably a bad idea, but it's just something I thought of. You could potentially setup an event handler in a standalone Java app that waits for an event that perl can fire. i.e. a file with a certain name gets created in a directory, then java's event handler fires and it knows to do it's thing. The Java method could then (again possibly but probably a horrible idea) write out a file to that same directory with a "requestid" in the file name so that perl knows when to stop monitoring that directory for the java functions output. Again this is most likely an incredibly horrible idea, but it's just an option.
| [reply] |
If you want to run perl and and java, you have to expect it to be slower than running just one of them. Even if you call out to an external java program, that's still going to be slower than either a pure Perl or pure Java implementation.
How big of a time difference do you see? How is that compared to the total run time in either implementation?
--
brian d foy <brian@stonehenge.com>
| [reply] |