6 ms·
I played around with Nashorn/jjs recently - if anyone's curious how roughly things work I did a little write-up here with a couple of examples showing some simp
by smcl 10y ago
I played around with Nashorn/jjs recently - if anyone's curious how roughly things work I did a little write-up here with a couple of examples showing some simple use-cases: http://blog.mclemon.io/discover-a-linux-utility-jjs http://blog.mclemon.io/discover-a-linux-utility-jjs
- softawre 10y agoWe are using J2V8, found Nashorn to be a bit lacking in performance.
- smcl 10y agoYep - you're right in that it's not fast. On my post I nabbed a graph from someone who did some performance measurements and the difference is pretty stark.
- jbrat 10y agoHow these tests are run will potentially create large differences. For instance, pure Nashorn will compile each script _every_ time before executing it. PurpleJS only compiles a script once and then caches it for re-use.
- Roboprog 10y agoI did a presentation on using Nashorn (and jjs) about a year ago at SacJUG (our local Java user group). It's pretty interesting the level at which you can intermix Java and Javascript in Nashorn. I tinkered with the idea of using a library called Spark on Netty to make web services in JS, but this library (and others mentioned here) actually did the job :-) https://docs.google.com/presentation/d/19KTud9_3I3MgJiYlVdF9SvCV8GcAvOFEjjY9ga0X3Y4/edit#slide=id.p https://docs.google.com/presentation/d/19KTud9_3I3MgJiYlVdF9... https://github.com/roboprog/nashorn_play https://github.com/roboprog/nashorn_play
- Roboprog 10y agoI also did a lightning talk demo on Nashorn vs Node performance a few months ago (local JS user group). For the little string mashing benchmark I put together (originally to compare sequential / fork / thread performance in various languages), Nashorn's (Java 8) JIT eventually catches up and passes Node. Alas, it's one of those "O(n) for large n" problems where n has to be around a million before this happens. ... And Perl still mops the floor up with all of them. (Perl is good at string handling, even if not so much at many other things)
- smcl 10y agoI actually used Spark via the "Nasven" wrapper for maven to create the simple thumbnail server I wrote about on my post (it's at the end of a lot of boring text): https://github.com/smcl/thumbooo https://github.com/smcl/thumbooo