|
|
Subscribe / Log in / New account

language-implementation startup times

language-implementation startup times

Posted Dec 4, 2014 10:54 UTC (Thu) by dgm (subscriber, #49227)
In reply to: language-implementation startup times by Per_Bothner
Parent article: Kawa — fast scripting on the Java platform

> I find it difficult to understand why you care whether it takes 0.1 seconds or 0.3 seconds, or why 0.06 elicits a "could be better, could be worse".

One reason may be that when you extrapolate to slower systems, 0.1 seconds on an i7 could be the difference between acceptable and unbearable. I just ran your test on the Raspberry Pi I'm currently developing for:

 time java -jar kawa-2.0.jar -e '(format #t "hello~%")'
 hello

 real    0m7.720s
 user    0m7.260s
 sys     0m0.430s
That's almost 8 seconds, just to print "hello". For comparison:
 time (gcc -o hello hello.c && ./hello)
 hello
 real    0m1.967s
 user    0m0.520s
 sys     0m0.040s
And after that:
 time ./hello
 hello
 real    0m0.009s
 user    0m0.000s
 sys     0m0.000s
But also:
 time (javac Hello.java && java Hello)
 hello

 real    0m13.716s
 user    0m12.750s
 sys     0m0.860s
And then:
 time java Hello
 hello

 real    0m1.618s
 user    0m1.460s
 sys     0m0.150s
While the relation is not linear, Idupree's tests give me a hint of how usable would be Kawa for my project.


to post comments

language-implementation startup times

Posted Dec 4, 2014 15:42 UTC (Thu) by Per_Bothner (subscriber, #7375) [Link]

One reason may be that when you extrapolate to slower systems, 0.1 seconds on an i7 could be the difference between acceptable and unbearable.

Point taken. On a slower system you might to use a different JVM, or perhaps a more limited version of Java, such as one that implements Java ME (rather than Java SE). These are designed for hardware that is slower or has less memory.

Specifically Android, which is sufficiently Java-like that I ported Java to it a few years ago. Android is of course designed for more resource-restricted environments than traditional Java (though these days a smart-phone is pretty powerful). The main limitation of Kawa for Android is that it currently doesn't support eval - everything has to be pre-compiled. This is because Android doesn't run Java bytecodes directly - Java .class files have to be translated to Dalvik ahead-of-time. It looks like it should be possible to fix this, either being by using a library to do the translation on the device, or to modify Kawa to generate Dalvik bytecode directly. However, I haven't looked into this.

I haven't experimented with Kawa on "micro" systems except for Android. However, if Kawa depends on some Java language or library feature that is not available on your platform of interest, I will happily work with you to avoid the dependency. The Kawa conditional-compilation framework (see the PreProcess class) is very useful for this.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds