I've used Inline::Java for 2 main projects in my $work: one is a
wrapper around the Maven libraries to introspect POMs, the other is a
long run daemon using an internal java library. I've found it to be
extremely reliable. To help maintain performance, keep in mind the
following:

1. use the JNI interface so that all Perl<->Java communication happens
in the same process. the other mode runs a separate process and
communicates over a unix socket.
2. more importantly, plan very carefully your calls (method calls,
property lookups, object construction, etc.) from Perl to Java. I've
found that the time to communicate even simple data can take much
longer that the time taken to process that data (to much context
switching).

(2) for me was exemplified for me on wrapping our internal Java
library. I was doing lots of back-and-forth. After implementing a
Java-side layer that did the same calls I was doing from Perl, I saw a
significant speed boost.

Hope this helps.

On Tue, May 28, 2013 at 8:59 PM, David Larochelle <[email protected]> wrote:
> Does anyone have experience with Inline::Java?
>
> I did some basic tests with it and it seems to work but I'm concerned about
> its reliability in production use.
>
> The use case is a large data processing system implemented in Perl. I'd
> like to add an algorithm (Conditional Random Fields) that's not implemented
> on CPAN but is available as a Java library.
> I'm hoping to use Inline::Java to allow this algorithm to be called from
> the existing Perl code.
> An alternative is to execute the Java code as a separate process and pass
> data to the Perl process with pipes and files.
>
> In my case the Java code will be run around 50,000 times a day to process
> incoming data. So I want to make sure that whatever solution I use is
> stable and low overhead.
>
> Thanks,
>
> David
>
> _______________________________________________
> Boston-pm mailing list
> [email protected]
> http://mail.pm.org/mailman/listinfo/boston-pm



-- 
William Cox

email: [email protected]
sgp.cm/mydimension

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d- s+:+() a C++(++++)$ UBLC(++)$
P+++(++++)$ L++(+++)$ !E--- W++(+++)$
!N !o? K--? !w--- !O M++ !V- PS-(--)@ PE+()
Y+ !PGP t++ !5 X+++ !R tv(+) b+>++
DI+(++) D+() G e h--- r+++ y+++>++++
------END GEEK CODE BLOCK------

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to