Loading ...
Sorry, an error occurred while loading the content.

Re: [jslint] JSLint using Spidermonkey

Expand Messages
  • dom@happygiraffe.net
    ... Don t dismiss the speed of the JVM idly. It s usually a lot faster than you expect, _when running_. The startup time is still poor, but the speed when
    Message 1 of 17 , Jul 24 5:07 PM
    • 0 Attachment
      On Fri, Jul 24, 2009 at 06:58:09PM -0000, z_mikowski wrote:
      > The main point of the article appears to be the speed of the
      > spidermonkey implementation. Conceptually, with less interpreters in
      > the chain, things should go faster.
      >
      > jslint -> spidermonkey -> machine code
      > jslint -> rhino -> java -> byte code -> machine code

      Don't dismiss the speed of the JVM idly. It's usually a lot faster than
      you expect, _when running_. The startup time is still poor, but the
      speed when you have HotSpot up and running is very good.

      http://en.wikipedia.org/wiki/HotSpot

      > Of course some aspects of the java implementation can be mitigated by
      > keeping a copy memory resident for batch operations. However, even
      > with that, one of spidermonkey's primary benefits are its speed
      > (witness FF3.5).

      That speed increase comes from tracemonkey. I'm not sure if this as
      percolated into the spidermonkey builds that are available yet. As with
      all such things, measure in detail if you care.

      http://en.wikipedia.org/wiki/Tracemonkey#TraceMonkey

      In fact, a quick look at <http://ftp.mozilla.org/pub/mozilla.org/js>
      shows that spidermonkey 1.7.0 was released on 19-Oct-2007, well before
      tracemonkey was around. There's a 1.8.0-rc1 in that directory, but
      according to the release notes at
      <https://developer.mozilla.org/En/SpiderMonkey/1.8>, that still doesn't
      include the tracemonkey work.

      -Dom
    • z_mikowski
      Thanks Dom. As a mod_perl developer, I m keen on cached byte code, but really haven t kept up with all the details on JVM optimizations :) To be fair, speed
      Message 2 of 17 , Jul 25 12:33 PM
      • 0 Attachment
        Thanks Dom.

        As a mod_perl developer, I'm keen on cached byte code, but really haven't kept up with all the details on JVM optimizations :) To be fair, speed really isn't that important to me right now. If it becomes an issue with automated builds, then I will re-approach and share my experience here.

        http://code.google.com/p/jslint4java/ sounds really good. Since it is more current than the version I'm currently running, I may give it a spin. Thank you for sharing!

        Sincerely, Mike


        --- In jslint_com@yahoogroups.com, dom@... wrote:
        >
        > On Fri, Jul 24, 2009 at 06:58:09PM -0000, z_mikowski wrote:
        > > The main point of the article appears to be the speed of the
        > > spidermonkey implementation. Conceptually, with less interpreters in
        > > the chain, things should go faster.
        > >
        > > jslint -> spidermonkey -> machine code
        > > jslint -> rhino -> java -> byte code -> machine code
        >
        > Don't dismiss the speed of the JVM idly. It's usually a lot faster than
        > you expect, _when running_. The startup time is still poor, but the
        > speed when you have HotSpot up and running is very good.
        >
        > http://en.wikipedia.org/wiki/HotSpot
        >
        > > Of course some aspects of the java implementation can be mitigated by
        > > keeping a copy memory resident for batch operations. However, even
        > > with that, one of spidermonkey's primary benefits are its speed
        > > (witness FF3.5).
        >
        > That speed increase comes from tracemonkey. I'm not sure if this as
        > percolated into the spidermonkey builds that are available yet. As with
        > all such things, measure in detail if you care.
        >
        > http://en.wikipedia.org/wiki/Tracemonkey#TraceMonkey
        >
        > In fact, a quick look at <http://ftp.mozilla.org/pub/mozilla.org/js>
        > shows that spidermonkey 1.7.0 was released on 19-Oct-2007, well before
        > tracemonkey was around. There's a 1.8.0-rc1 in that directory, but
        > according to the release notes at
        > <https://developer.mozilla.org/En/SpiderMonkey/1.8>, that still doesn't
        > include the tracemonkey work.
        >
        > -Dom
        >
      • Re Miya
        ... What is worth considering here is not the JVM startup time (which actually is not that much), but that the implementation is OS independent. You write it
        Message 3 of 17 , Jul 29 11:07 AM
        • 0 Attachment
          --- In jslint_com@yahoogroups.com, dom@... wrote:
          >
          > On Thu, Jul 23, 2009 at 11:00:55AM -0700, re miya wrote:
          > > You don't need to use neither Rhino neither Spidermonkey.
          > >
          > > Java has scripting enabled since version 6.0, and it runs jslint just fine.
          > >
          > > The implementation takes no more than 8 lines of code.
          >
          > Internally, that's still calling rhino. And it doesn't mitigate the
          > startup time of the JVM.
          >
          > -Dom
          >

          What is worth considering here is not the JVM startup time (which actually is not that much), but that the implementation is OS independent. You write it once and it runs everywhere. And running it out of the box without using Rhino as a separate package, removes the limits imposed by using it.
        • Arthur Blake
          I know this is getting a little off-topic, but I still think it s related and relevant to JSLint. With preliminary testing, using spidermonkey instead of Java
          Message 4 of 17 , Aug 1, 2009
          • 0 Attachment
            I know this is getting a little off-topic, but I still think it's related
            and relevant to JSLint. With preliminary testing, using spidermonkey
            instead of Java 6 scripting (aka Rhino), I am seeing a speedup factor of
            about 20x. This is really significant, because I can compress a large file
            (using Dean Edwards packer) algorithm that previously took about 40 seconds,
            in about 2 seconds with spidermonkey! This allows the packer compressor to
            actually compress faster than the YUI compressor in some cases! I'll be
            updating the compressorater to use spidermonkey soon.

            On Wed, Jul 29, 2009 at 2:07 PM, Re Miya <remiya_ws@...> wrote:

            >
            >
            > --- In jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>, dom@...
            > wrote:
            > >
            > > On Thu, Jul 23, 2009 at 11:00:55AM -0700, re miya wrote:
            > > > You don't need to use neither Rhino neither Spidermonkey.
            > > >
            > > > Java has scripting enabled since version 6.0, and it runs jslint just
            > fine.
            > > >
            > > > The implementation takes no more than 8 lines of code.
            > >
            > > Internally, that's still calling rhino. And it doesn't mitigate the
            > > startup time of the JVM.
            > >
            > > -Dom
            > >
            >
            > What is worth considering here is not the JVM startup time (which actually
            > is not that much), but that the implementation is OS independent. You write
            > it once and it runs everywhere. And running it out of the box without using
            > Rhino as a separate package, removes the limits imposed by using it.
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Dominic Mitchell
            ... That s very interesting. Just out of curiosity, how much of that is down to startup time? If you do some start/end timing in the code, how long does it
            Message 5 of 17 , Aug 1, 2009
            • 0 Attachment
              On 1 Aug 2009, at 15:04, Arthur Blake wrote:

              > I know this is getting a little off-topic, but I still think it's
              > related
              > and relevant to JSLint. With preliminary testing, using spidermonkey
              > instead of Java 6 scripting (aka Rhino), I am seeing a speedup
              > factor of
              > about 20x. This is really significant, because I can compress a
              > large file
              > (using Dean Edwards packer) algorithm that previously took about 40
              > seconds,
              > in about 2 seconds with spidermonkey! This allows the packer
              > compressor to
              > actually compress faster than the YUI compressor in some cases!
              > I'll be
              > updating the compressorater to use spidermonkey soon.


              That's very interesting. Just out of curiosity, how much of that is
              down to startup time? If you do some start/end timing in the code,
              how long does it take to execute the compressor.

              The reason I ask is that I noticed it took jsilnt4java a significant
              amount of time to 1) load the JVM and 2) parse fulljslint.js. The
              actual validation took very little time in comparison.

              -Dom

              [Non-text portions of this message have been removed]
            • Arthur Blake
              None of my timing includes startup time- as my application is a server (web app) and it s always running, more or less... ... [Non-text portions of this
              Message 6 of 17 , Aug 2, 2009
              • 0 Attachment
                None of my timing includes startup time- as my application is a server (web
                app) and it's always running, more or less...

                On Sun, Aug 2, 2009 at 2:44 AM, Dominic Mitchell <dom@...>wrote:

                >
                >
                >
                > On 1 Aug 2009, at 15:04, Arthur Blake wrote:
                >
                > > I know this is getting a little off-topic, but I still think it's
                > > related
                > > and relevant to JSLint. With preliminary testing, using spidermonkey
                > > instead of Java 6 scripting (aka Rhino), I am seeing a speedup
                > > factor of
                > > about 20x. This is really significant, because I can compress a
                > > large file
                > > (using Dean Edwards packer) algorithm that previously took about 40
                > > seconds,
                > > in about 2 seconds with spidermonkey! This allows the packer
                > > compressor to
                > > actually compress faster than the YUI compressor in some cases!
                > > I'll be
                > > updating the compressorater to use spidermonkey soon.
                >
                > That's very interesting. Just out of curiosity, how much of that is
                > down to startup time? If you do some start/end timing in the code,
                > how long does it take to execute the compressor.
                >
                > The reason I ask is that I noticed it took jsilnt4java a significant
                > amount of time to 1) load the JVM and 2) parse fulljslint.js. The
                > actual validation took very little time in comparison.
                >
                > -Dom
                >
                > [Non-text portions of this message have been removed]
                >
                >
                >


                [Non-text portions of this message have been removed]
              • dom@happygiraffe.net
                ... Thank you -- that s even more impressive. -Dom
                Message 7 of 17 , Aug 2, 2009
                • 0 Attachment
                  On Sun, Aug 02, 2009 at 09:14:22AM -0400, Arthur Blake wrote:
                  > None of my timing includes startup time- as my application is a server (web
                  > app) and it's always running, more or less...

                  Thank you -- that's even more impressive.

                  -Dom
                • Arthur Blake
                  Yeah, it s amazing how fast spidermonkey is... the latest versions that have tracemonkey rival native C code:Great blog post about it (almost a year old
                  Message 8 of 17 , Aug 2, 2009
                  • 0 Attachment
                    Yeah, it's amazing how fast spidermonkey is... the latest versions that have
                    tracemonkey rival native C code:Great blog post about it (almost a year old
                    now...) here: http://ejohn.org/blog/tracemonkey/

                    On Sun, Aug 2, 2009 at 5:02 PM, <dom@...> wrote:

                    >
                    >
                    > On Sun, Aug 02, 2009 at 09:14:22AM -0400, Arthur Blake wrote:
                    > > None of my timing includes startup time- as my application is a server
                    > (web
                    > > app) and it's always running, more or less...
                    >
                    > Thank you -- that's even more impressive.
                    >
                    > -Dom
                    >
                    >
                    >


                    [Non-text portions of this message have been removed]
                  • mnewton32@yahoo.ca
                    Has anyone been able to get the modified JSLint running with a TraceMonkey-enabled build of SpiderMonkey? SpiderMonkey 1.7 is a few years old at this point. So
                    Message 9 of 17 , Aug 2, 2009
                    • 0 Attachment
                      Has anyone been able to get the modified JSLint running with a TraceMonkey-enabled build of SpiderMonkey? SpiderMonkey 1.7 is a few years old at this point. So I tried building it from the mozilla-central repository and the Firefox 3.51 tarball. Both times I got errors in the readline() loop. Otherwise the builds seem fine.

                      Sent from my BlackBerry device on the Rogers Wireless Network

                      -----Original Message-----
                      From: Arthur Blake <arthur.blake@...>

                      Date: Sun, 2 Aug 2009 23:46:30
                      To: <jslint_com@yahoogroups.com>
                      Subject: Re: [jslint] JSLint using Spidermonkey


                      Yeah, it's amazing how fast spidermonkey is... the latest versions that have
                      tracemonkey rival native C code:Great blog post about it (almost a year old
                      now...) here: http://ejohn.org/blog/tracemonkey/

                      On Sun, Aug 2, 2009 at 5:02 PM, <dom@...> wrote:

                      >
                      >
                      > On Sun, Aug 02, 2009 at 09:14:22AM -0400, Arthur Blake wrote:
                      > > None of my timing includes startup time- as my application is a server
                      > (web
                      > > app) and it's always running, more or less...
                      >
                      > Thank you -- that's even more impressive.
                      >
                      > -Dom
                      >
                      >
                      >


                      [Non-text portions of this message have been removed]




                      [Non-text portions of this message have been removed]
                    • Arthur Blake
                      I got the spidermonkey tips to build and work fine... although I haven t tried it with JSLint. But I m sure it would work fine. It seems pretty stable,
                      Message 10 of 17 , Aug 2, 2009
                      • 0 Attachment
                        I got the spidermonkey tips to build and work fine... although I haven't
                        tried it with JSLint. But I'm sure it would work fine. It seems pretty
                        stable, although it is not a release build by any means...
                        I am in the process of trying to get the TraceMonkey version in FF 3.52 to
                        build as well. If you figure it out before I do, post back here. I'll try
                        to do the same.
                        BTW, I solved the newline problem just by passing in my command object,
                        encapsulated as JSON... that way you can pass everything you want on one big
                        line and not worry about decoding newlines in the stream.

                        On Mon, Aug 3, 2009 at 12:05 AM, <mnewton32@...> wrote:

                        >
                        >
                        > Has anyone been able to get the modified JSLint running with a
                        > TraceMonkey-enabled build of SpiderMonkey? SpiderMonkey 1.7 is a few years
                        > old at this point. So I tried building it from the mozilla-central
                        > repository and the Firefox 3.51 tarball. Both times I got errors in the
                        > readline() loop. Otherwise the builds seem fine.
                        >
                        > Sent from my BlackBerry device on the Rogers Wireless Network
                        >
                        > -----Original Message-----
                        > From: Arthur Blake <arthur.blake@... <arthur.blake%40gmail.com>>
                        >
                        > Date: Sun, 2 Aug 2009 23:46:30
                        > To: <jslint_com@yahoogroups.com <jslint_com%40yahoogroups.com>>
                        > Subject: Re: [jslint] JSLint using Spidermonkey
                        >
                        >
                        > Yeah, it's amazing how fast spidermonkey is... the latest versions that
                        > have
                        > tracemonkey rival native C code:Great blog post about it (almost a year old
                        >
                        > now...) here: http://ejohn.org/blog/tracemonkey/
                        >
                        > On Sun, Aug 2, 2009 at 5:02 PM, <dom@...<dom%40happygiraffe.net>>
                        > wrote:
                        >
                        > >
                        > >
                        > > On Sun, Aug 02, 2009 at 09:14:22AM -0400, Arthur Blake wrote:
                        > > > None of my timing includes startup time- as my application is a server
                        > > (web
                        > > > app) and it's always running, more or less...
                        > >
                        > > Thank you -- that's even more impressive.
                        > >
                        > > -Dom
                        > >
                        > >
                        > >
                        >
                        >
                        > [Non-text portions of this message have been removed]
                        >
                        >
                        >
                        > [Non-text portions of this message have been removed]
                        >
                        >
                        >


                        [Non-text portions of this message have been removed]
                      Your message has been successfully submitted and would be delivered to recipients shortly.