Thanks William, My biggest concern with Inline::Java is why it isn't more widely known and used. For data analysis, there are two main choices: Python and the JVM stack. CPAN is nice but it just doesn't have the data libraries these platforms do. It would seem like Inline::Java would be frequently touted as a savor of Perl letting you write code that uses both powerful Java libraries and CPAN while still having the benefits of Perl.
Are the reasons why Inline::Java isn't more widely known and used cultural? E.g. Perl developers have an aversion to Java, most Perl developers don't need data analysis, Inline::Java is badly marketed, etc. Or are there technical reasons why Inline::Java is less attractive than it first appears? Would it make sense to use Inline::Java and Perl for a green field project or would it be better to just use Java or other JVM languages such as Scala or Jython when Java libraries are a major component? -- David On Tue, May 28, 2013 at 10:42 PM, William Cox <mydimens...@gmail.com> wrote: > 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 <da...@larochelle.name> > 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 > > Boston-pm@mail.pm.org > > http://mail.pm.org/mailman/listinfo/boston-pm > > > > -- > William Cox > > email: mydimens...@gmail.com > 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 Boston-pm@mail.pm.org http://mail.pm.org/mailman/listinfo/boston-pm