Jim Freeze <jim / freeze.org> wrote in message news:<20030828184837.A68396 / freeze.org>...
> On Friday, 29 August 2003 at  5:34:15 +0900, Brian Candler wrote:
> > On Thu, Aug 28, 2003 at 04:48:37AM +0900, Jim Freeze wrote:
> > > Hmm, I'm sitting here with a Sun box and a Linux box and
> > > thought I'd try this myself. Here are the results:
> > > 
> > > Ruby:
> > > time ruby tail
> > > 499999500000
> > > 1.250u 0.000s 0:01.23 101.6%    0+0k 0+0io 212pf+0w
> > > 
> > > Sun:
> > > time ruby tail
> > > 499999500000
> > > 11.36u 0.05s 0:11.50 99.2%
> > > 
> > > BTW, both were built with the latest 1.8.0.
> > 
> > Should the first one read "Linux" not "Ruby" ?
> 
> Yeah, duh. #sub(/Ruby/,"Linux")
> 
> > 
> > Suns have always appeared incredibly slow to me - in particular when
> > compiling applications (a compiler seems to be a pretty good processor
> > workout). Unless gcc has to do a *lot* more work to generate and optimise
> > Sparc code than Intel code (which I doubt), then the conclusion seems to be
> > that Sparcs are slow. Possibly also that Solaris is slow.
> > 
> 
> Yes, Sun is very slow. Also, you showed a time of about 11.36 for Ruby.
> I assume that was on a Sun box.
> Is the ratio between OCaml and Ruby the same on Linux, or does
> Ruby improve?

Maybe you're using the wrong Sun:

  $ time ruby tail   # blind gcc compile
  499999500000

  real    0m3.943s
  user    0m3.910s
  sys     0m0.000s

or the wrong compiler:

  $ time ruby tail   # Sun compiler with optimizations[1]
  499999500000

  real    0m1.608s
  user    0m1.590s
  sys     0m0.010s

Of course, some people care a little more about IO than addition!

Steve

[1] CFLAGS="$(getconf LFS64_CFLAGS) -dalign -fns -ftrap=%none -nofstore
            -xbuiltin=%all -xtarget=native -xarch=v9 -xO5 -D__sparc_v9__"
    LDFLAGS="$(getconf LFS64_LDFLAGS) -L/opt/SUNWspro/WS6U2/lib"
    DLDFLAGS="$(getconf LFS64_LDFLAGS) -L/opt/SUNWspro/WS6U2/lib"
    LIBS="$(getconf LFS64_LIBS) -lfast"