Get nashron work in opnjdk8

AMILA RANATUNGA newair007 at gmail.com
Fri Feb 8 22:26:45 PST 2013


Hi,

Thanks a lot for the replies so far. I am also working on that project. It
was server side scripting with javascript previously implemented on top of
Rhino, using its host objects. Now we are considering increasing its
performance. Since both Rhino and Nashorn has similar java access and using
Nashorn rather than v8 will give us much more advantages . We also have a
requirement of enable that server in embedded devices.
  Yes it might not be worth to decide just on micro benchmark numbers. But
there is a requirement of doing such a comparison.  What benchmark suits
would you recommend to measure Nashorn performance with v8 other than v8
benchmark ?.


Thanks ..!!


On Sat, Feb 9, 2013 at 11:53 AM, Harsha Kumara <harsz89 at gmail.com> wrote:

> Thank you very much for the detailed description.It opens many areas to
> think about when selecting a java script engine.There is existing project
> called jaggary [0] which is written above the rhino java script engine.It
> allows developers to write web application using pure java script.But the
> low performance of Rhino make us to write jaggary framework
> using separate java script engine.Our one of major target is to embed
> jaggary in a small devices like android mobile or Raspberry PI
> machine.To achieve our goals we need to select java script engine which
> support these functionality.Since nashorn expose a api similar to Rhino and
> support with embedding will make us our work much easier and need to
> consider twice about doing the project.We have done some performance
> comparisons using existing java-script test frameworks and it gives us V8
> perform well in many cases.We will look into what needs most in
> jaggary.Thanks heaps for the help.
>
> [0]-*jaggeryjs*.org/
>
> On Sat, Feb 9, 2013 at 10:48 AM, A. Sundararajan <
> sundararajan.athijegannathan at oracle.com> wrote:
>
> > Hi
> >
> > I am not sure I understand your sense of what "best javascript engine"
> is.
> >  What is the comparison that you are interested? What kind of application
> > load you'd expect? Pure javascript number cruching and object/array
> > manipulation only? You mentioned server-side project. I am sure your
> > project would involve libraries (network, xml, database , webservices
> > etc.). It may not be appropriate to decide just based on micro-benchmark
> > numbers alone. For Java, apart from JDK itself, there are tons of
> libraries
> > to deal with server side requirements.
> >
> > If it is the choice b/w rhino and nashorn, then you've similar java
> access
> > (you can access any Java package from both, implement interfaces, extend
> > classes and son).  Nashorn is always compiled/jsr292 based. Rhino has
> > interpreted mode as well as "optimizer" mode. From our measurements,
> > nashorn performs better than rhino on many v8 benchmarks ( which are pure
> > JS number crunching, object/array manipulations etc.)
> >
> > Also, because nashorn always compiles and java library calls are not
> based
> > on reflection - instead it uses dynalink library. Essentially method
> > handles to Java classes - which should perform better in long running
> > scripts. We don't (yet) have perf. comparison of java access. As Marcus
> > already pointed out, unless you do proper "warm up", you'll get
> misleading
> > numbers with Java programs - not just nashorn.
> >
> > Hope this helps,
> > -Sundar
> >
> >
> >
> > On Saturday 09 February 2013 10:10 AM, Harsha Kumara wrote:
> >
> >> I have downloaded the jdk8 build 75 which is available in the
> java.netand
> >> run tests separately.Still I got rhino perform well than nashorn.Is
> >> something I doing wrong here?Or is there anyway to set performance
> >> parameters for nashorn?Because for our final year university project,we
> >> need to find the currently available best java script engine.Since we
> >> working on server side java scripting project.We found that V8 perform
> >> well
> >> than rhino.After do some research we got to know that nashorn will
> become
> >> a
> >> pretty handy java script engine.So if nashorn is better our project on
> V8
> >> not will much usable.Is there a place which we can have test results
> where
> >> we can compare v8,rhino,nashorn.
> >> Thanks!
> >> On Fri, Feb 8, 2013 at 9:52 PM, Harsha Kumara <harsz89 at gmail.com>
> wrote:
> >>
> >>  Thanks for the presentations resources.I downloaded latest rhino
> version
> >>> and load crypto file into the rhino and nashorn seperately and run the
> >>> encrypt method.
> >>> In rhino when i repeatedly run the encrypt method in the consolde I got
> >>> this results
> >>>
> >>> js> encrypt();
> >>> 54
> >>> js> encrypt();
> >>> 33
> >>> js> encrypt();
> >>> 27
> >>> js> encrypt();
> >>> 46
> >>> js> encrypt();
> >>> 28
> >>> js> encrypt();
> >>> 25
> >>> js> encrypt();
> >>> 35
> >>> js> encrypt();
> >>> 28
> >>> js> encrypt();
> >>> 27
> >>> js> encrypt();
> >>> 23
> >>> js> encrypt();
> >>> 26
> >>> js> encrypt();
> >>> 17
> >>> js> encrypt();
> >>> 24
> >>> js> encrypt();
> >>> 23
> >>> js> encrypt();
> >>> 26
> >>>
> >>> And when I run it in the nashorn
> >>>
> >>> jjs> encrypt();
> >>> 153
> >>> jjs> encrypt();
> >>> 125
> >>> jjs> encrypt();
> >>> 118
> >>> jjs> encrypt();
> >>> 114
> >>> jjs> encrypt();
> >>> 139
> >>> jjs> encrypt();
> >>> 53
> >>> jjs> encrypt();
> >>> 51
> >>> jjs> encrypt();
> >>> 56
> >>> jjs> encrypt();
> >>> 49
> >>> jjs> encrypt();
> >>> 49
> >>> jjs> encrypt();
> >>> 47
> >>> jjs> encrypt();
> >>> 72
> >>> jjs> encrypt();
> >>> 46
> >>> jjs> encrypt();
> >>> 36
> >>> jjs> encrypt();
> >>> 25
> >>> jjs> encrypt();
> >>> 27
> >>> jjs> encrypt();
> >>> 36
> >>> jjs> encrypt();
> >>> 31
> >>> jjs> encrypt();
> >>> 26
> >>> jjs> encrypt();
> >>> 25
> >>> jjs> encrypt();
> >>> 24
> >>> jjs> encrypt();
> >>> 25
> >>> jjs> encrypt();
> >>> 33
> >>> jjs> encrypt();
> >>> 40
> >>> jjs> encrypt();
> >>> 27
> >>> jjs> encrypt();
> >>> 27
> >>> jjs> encrypt();
> >>> 26
> >>> jjs> encrypt();
> >>> 103
> >>> jjs> encrypt();
> >>> 134
> >>> jjs> encrypt();
> >>> 40
> >>> jjs> encrypt();
> >>> 23
> >>> jjs> encrypt();
> >>> 26
> >>> jjs> encrypt();
> >>> 27
> >>> jjs> encrypt();
> >>> 26
> >>> jjs> encrypt();
> >>> 28
> >>> jjs> encrypt();
> >>> 24
> >>>
> >>> I have got this variate results.I have attach the crypto file.Any idea
> is
> >>> this why this varying?
> >>>
> >>> On Fri, Feb 8, 2013 at 9:15 PM, Marcus Lagergren <
> >>> marcus.lagergren at oracle.com> wrote:
> >>>
> >>>  Actually, Nashorn currently beats v8 on the splay benchmark in the
> >>>> Octane
> >>>> suite, but for pure number crunching tests like crypto we are still
> >>>> behind,
> >>>> as we don't have the luxury of our own native value representation -
> >>>> producing strongly typed Java byte code is rather high level for a
> >>>> runtime.
> >>>> We have several tricks up our sleeve though, both on the JVM side and
> in
> >>>> Nashorn itself, so this gap is expected to get smaller.
> >>>>
> >>>> If you want to know more about how to implement dynamic languages on
> the
> >>>> JVM and get some performance out of it, I did a presentation at Devoxx
> >>>> last
> >>>> November that is freely available online.
> >>>> http://www.devoxx.com/display/**DV12/Nashorn++Optimizing+**
> >>>> JavaScript+and+Dynamic+**Language+Execution+on+the+JVM<
> http://www.devoxx.com/display/DV12/Nashorn++Optimizing+JavaScript+and+Dynamic+Language+Execution+on+the+JVM
> >
> >>>>
> >>>> Regards
> >>>> Marcus
> >>>>
> >>>> On Feb 8, 2013, at 4:04 PM, Harsha Kumara <harsz89 at gmail.com> wrote:
> >>>>
> >>>>  Yeap.I have build the nashron by checkout it.I'll run tests again
> >>>>>
> >>>> compare
> >>>>
> >>>>> with rhino.I went through some articles and some of articles express
> >>>>>
> >>>> that
> >>>>
> >>>>> nashorn is faster and perform well than v8 java script engine.But the
> >>>>> performance of the v8 is still higher than the nashorn I guess.I did
> >>>>>
> >>>> some
> >>>>
> >>>>> bechmark test with v8 and nashorn.So far v8 perform well.Am I
> >>>>>
> >>>> correct?are
> >>>>
> >>>>> there a any ways to tune nashorn to perform faster?
> >>>>>
> >>>>> On Fri, Feb 8, 2013 at 8:01 PM, Hannes Wallnoefer <
> >>>>> hannes.wallnoefer at oracle.com> wrote:
> >>>>>
> >>>>>  Am 2013-02-08 15:00, schrieb Harsha Kumara:
> >>>>>>
> >>>>>> I have locally build openjdk8 forest.Then I set java home to jdk8
> >>>>>>
> >>>>> which was
> >>>>
> >>>>> build from my local build.I think the way i ran jjs is not
> >>>>>>
> >>>>> correct.Using
> >>>>
> >>>>> consoe I ran ./jjs then I got the console.Afterthat I manually load
> >>>>>> javascript file using load function (ed:load("foo.js")) and call the
> >>>>>> function.Is that correct?
> >>>>>>
> >>>>>>
> >>>>>> If you were able to load and run JavaScript you probably did
> >>>>>> everything
> >>>>>> right.
> >>>>>>
> >>>>>> However, if you just want to play with Nashorn the simpler option
> may
> >>>>>>
> >>>>> be
> >>>>
> >>>>> to use an official JDK preview release from
> >>>>>> http://jdk8.java.net/download.**html<
> http://jdk8.java.net/download.html>.
> >>>>>> You can use the following command
> >>>>>>
> >>>>> to
> >>>>
> >>>>> just get the Nashhorn sources:
> >>>>>>
> >>>>>> hg clone http://hg.openjdk.java.net/**nashorn/jdk8/nashorn<
> http://hg.openjdk.java.net/nashorn/jdk8/nashorn>nashorn
> >>>>>>
> >>>>>> Hannes
> >>>>>>
> >>>>>>
> >>>>>> Thanks!
> >>>>>> On Fri, Feb 8, 2013 at 7:10 PM, Marcus Lagergren <
> >>>>>>
> >>>>> marcus.lagergren at oracle.com> wrote:
> >>>>
> >>>>>
> >>>>>> Can you tell us how you run it in JJS?
> >>>>>>
> >>>>>> For the best current Nashorn performance, any build over Java8 b74
> >>>>>>
> >>>>> should
> >>>>
> >>>>> be used, as it contains significant fixes to the inlining in the JVM.
> >>>>>> You probably need to give any microbenchmark a few warmup rounds for
> >>>>>> performance to stabilize. If you only run one round, there will be
> too
> >>>>>>
> >>>>> much
> >>>>
> >>>>> noise and warmup issues for results to be meaningful. This is
> >>>>>>
> >>>>> especially
> >>>>
> >>>>> true with  invoke dynamic based programs running on Java 8 now, as
> they
> >>>>>> tend to warm up slower than standard "Java" programs.
> >>>>>>
> >>>>>> Running with the octane test harness in the Nashorn repo (modified
> to
> >>>>>> provide multiple rounds for VM warmup)
> >>>>>> (after doing ant externals to get the benchmarks)
> >>>>>>
> >>>>>> java -jar dist/nashorn.jar test/script/basic/run-octane.**js --
> >>>>>> test/script/external/octane/**crypto.js --iterations 10 --verbose
> >>>>>>
> >>>>>> I get ~2000 points on my machine, where Rhino gives me ~850 points.
> >>>>>>
> >>>>>>
> >>>>>> /M
> >>>>>>
> >>>>>>
> >>>>>> On Feb 8, 2013, at 2:29 PM, Harsha Kumara <harsz89 at gmail.com> <
> >>>>>>
> >>>>> harsz89 at gmail.com> wrote:
> >>>>
> >>>>>
> >>>>>> Yeah the problem is i'm not quite sure whether I have configure the
> >>>>>>
> >>>>>> nashorn
> >>>>>>
> >>>>>> correctly.I had run crypto test in v8 bench mark test suit in jjs
> >>>>>>
> >>>>> console
> >>>>
> >>>>> it gives around 110ms to run the encryption operation where rhino
> just
> >>>>>>
> >>>>>> take
> >>>>>>
> >>>>>> around 31ms.My concern is how can I know whether I have correctly
> >>>>>>
> >>>>>> configure
> >>>>>>
> >>>>>> nashorn in my machine.
> >>>>>> Thanks!
> >>>>>>
> >>>>>> On Fri, Feb 8, 2013 at 6:52 PM, A. Sundararajan <
> >>>>>>
> >>>>> sundararajan.athijegannathan@**oracle.com<
> sundararajan.athijegannathan at oracle.com>>
> >>>> wrote:
> >>>>
> >>>>>
> >>>>>> [Please reply to list as it will be record for similar queries from
> >>>>>>
> >>>>>> others
> >>>>>>
> >>>>>> as well]
> >>>>>>
> >>>>>> You said it is not as fast as rhino on your test. Is it possible to
> >>>>>>
> >>>>>> share
> >>>>>>
> >>>>>> your test or reduced version of it demonstrating performance issue?
> >>>>>>
> >>>>>> thanks
> >>>>>> -Sundar
> >>>>>>
> >>>>>>
> >>>>>> On Friday 08 February 2013 06:15 PM, Harsha Kumara wrote:
> >>>>>>
> >>>>>>
> >>>>>> Hi!
> >>>>>>
> >>>>>> I have pull jdk8 and build it.Then I build nashron after setting
> java
> >>>>>> home poiting to the jdk8.But ant build return with a javadoc error.I
> >>>>>>
> >>>>>>   have
> >>>>>>
> >>>>>>   the nashron jar which is build during the ant build.And I ran jjs
> >>>>>> executable with a some test it's not fast as rhino.I wonder whether
> I
> >>>>>>
> >>>>>>   need
> >>>>>>
> >>>>>>   to other configuration to get nashron into play?
> >>>>>> Thanks!
> >>>>>>
> >>>>>> On Fri, Feb 8, 2013 at 5:59 PM, A. Sundararajan
> >>>>>>
> >>>>> <sundararajan.athijegannathan@****oracle.com<
> >>>>
> >>>>>   sundararajan.athijegannathan@**oracle.com<
> sundararajan.athijegannathan at oracle.com>
> >>>>>> ><mailto:
> >>>>>>
> >>>>>>   sundararajan.**athijegannathan**@oracle.com<
> athijegannathan at oracle.com>
> >>>>>> <
> >>>>>>
> >>>>>>   sundararajan.athijegannathan@**oracle.com<
> sundararajan.athijegannathan at oracle.com>
> >>>>>> >>>
> >>>>>>
> >>>>>>   wrote:
> >>>>>>
> >>>>>>    Hi,
> >>>>>>
> >>>>>>    Nashorn has not yet hit the openjdk8 main repo. You need to pull
> >>>>>>    nashorn forest for now:
> >>>>>>
> >>>>>>    http://hg.openjdk.java.net/****nashorn/jdk8<
> http://hg.openjdk.java.net/**nashorn/jdk8>
> >>>>>> <
> >>>>>>
> >>>>>>   http://hg.openjdk.java.net/**nashorn/jdk8<
> http://hg.openjdk.java.net/nashorn/jdk8>
> >>>>>> >
> >>>>>>
> >>>>>>      It'll be some time before nashorn hits main jdk8 repo. But, you
> >>>>>>    can pull the above forest in the interim and build it.
> >>>>>>
> >>>>>>    -Sundar
> >>>>>>
> >>>>>>
> >>>>>>    On Friday 08 February 2013 02:07 PM, Harsha Kumara wrote:
> >>>>>>
> >>>>>>        Hi!
> >>>>>>        I had tried to run some performance tests.But results are not
> >>>>>>        impressive
> >>>>>>        than I thought.I have build openjdk8 and set JAVA_HOME to
> >>>>>>        it.Then I have
> >>>>>>        build nashron.But when I run the jrunscript -q it still show
> >>>>>>        the rhino as
> >>>>>>        underline javascript engine.Then how can I configure it to
> use
> >>>>>>        nashron?
> >>>>>>        Thanks!
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> /Harsha Kumara/
> >>>>>> /Undergraduate/
> >>>>>> /Department of Computer Science and Engineering/
> >>>>>> /University of Moratuwa/
> >>>>>> /Sri Lanka./
> >>>>>>
> >>>>>>
> >>>>>>   --
> >>>>>> *Harsha Kumara*
> >>>>>> *Undergraduate*
> >>>>>> *Department of Computer Science and Engineering*
> >>>>>> *University of Moratuwa*
> >>>>>> *Sri Lanka.*
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> --
> >>>>> *Harsha Kumara*
> >>>>> *Undergraduate*
> >>>>> *Department of Computer Science and Engineering*
> >>>>> *University of Moratuwa*
> >>>>> *Sri Lanka.*
> >>>>>
> >>>>
> >>>>
> >>> --
> >>> *Harsha Kumara*
> >>> *Undergraduate*
> >>> *Department of Computer Science and Engineering*
> >>> *University of Moratuwa*
> >>> *Sri Lanka.*
> >>>
> >>>
> >>
> >>
> >
>
>
> --
> *Harsha Kumara*
> *Undergraduate*
> *Department of Computer Science and Engineering*
> *University of Moratuwa*
> *Sri Lanka.*
>


More information about the nashorn-dev mailing list