Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
Another question: how do I ensure rJava is bytecode-compiled? I seem to re-install the package with setting compilePKGS(T) before i install it again, but most of rJava functions however seem to come back still as not bytecode-compiled. Thank you in advance. -dmitriy On Fri, Mar 16, 2012 at 3:48 P

Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
The "low level" seems to be much-much better though... not sure why the difference would be so fundamental... f <- function() system.time( for( i in 1:1000) .jcall("java/lang/Math", returnSig="D", "abs", as.numeric(i) ) ) > f() user system elapsed 0.080 0.000 0.083 On Fri, Mar 16, 2012

Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
PS caching reference to the class doesn't change anything fundamentally: clazz <- J("java.lang.Double") system.time( for( i in 1:1000) clazz$ parseDouble(as.character(i))) user system elapsed 3.788 0.000 3.790 Java parsing is slow??? nope, still looking pretty appalling for what it does

[R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
Hello, I am getting pretty poor rJava call performance > system.time(for (i in 1:1000) > J("java.lang.Double")$parseDouble(as.character(i))) user system elapsed 4.884 0.000 4.900 i.e. 5 milliseconds per very simple call on a very fast cpu. JNI calls themselves are said to be pretty