[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [computer-go] Score estimating



As a  follow up, I  picked a test  more or less  at random in  the the
language shootout page.  It was the "nested loops" test.  They provide
the source code to each language implementation.

In this test, c and c++ came  out about the same (C++ is a superset of
C  and if  you don't  use the  c++ features  there is  no  slowdown, I
suspect that is happening here.)

The fastest java complier came out over 3X slower on this test.
Ocaml was significantly slower too, about 11.6  to 1.

The language I wished I could use, "ruby" came out over 10X slower.

The results  can vary significantly  depending on which  benchmark you
choose, so I picked another, the Sieve of Eratosthenes.

On the  sieve, the  C compiler was  0.10, Ocaml  was 0.12 and  c++ was
0.15.  The fastest Java compiler was  0.29, again about 2X slower than
C++ and 3X slower than C.

You are  not likely to get much  faster than C.  As  wonderful as high
level languages like java are, they can't compete.  The reason is that
C is  pretty much a  super fancy assembly  language.  You can  make it
easier to program  but you almost have to give  away performance to do
this.

I think Dave Fotland said it best when he brought up the point that GO
program depend a great deal  on encoded knowledge.  It's well known in
computer  science  that  a  simple  choice of  algorithm  can  make  a
difference  of many orders  of magnitude.   We are  at the  point with
computer  go that  minor improvements  in the  "knowledge engineering"
side of things  is worth a lot  more than a lot of  extra power.  It's
not that power isn't important, it's  just that no one has figured out
how to properly  utilize it.  Program bugs are kind  of the same thing
in a way, a single serious bug can nullify everything else.

- Don


   Date: Sun, 8 Aug 2004 14:22:41 -0400
   From: Don Dailey <drd@xxxxxxxxxxxxxxxxx>

   Your numbers  seem amazing to me.   I've never seen  java described as
   being  just  about  the same  speed  as  C++.   At  any rate,  C++  is
   significantly slower than C code.

   Of course,  as always, it depends  exactly on what you  are doing.  If
   you can arrange your code such  that it spends most of it's time doing
   calls  that are actually  written in  C anyway,  such as  library sort
   routines in most languages, everything comes out the same.

   If you look at the great  computer language shootout page, you can get
   some comparisons, Java  doesn't compare at all in  speed to c++.  They
   have the  usual disclaimers about the  usefulness of the  tests, but I
   find  it as  good  as anything  else.   They take  a  huge variety  of
   programming tasks,  implement them in many languages  and compare them
   based on many metrics, such as speed of the application.

   Some application  that is very simplistic  may very well  run the same
   speed in most languages, such as  the sort example I gave or something
   that is  heavily I/O bound.   Such applications are  generally running
   routines built  in C  or spending most  of their time  doing operating
   system calls.  Not things a good GO program would be doing.


   - Don


      X-Originating-IP: [68.255.21.214]
      X-Originating-Email: [weiminxiao@xxxxxxxxxxxxxxxxx]
      X-Sender: weiminxiao@xxxxxxxxxxxxxxxxx
      From: "Weimin Xiao" <weiminxiao@xxxxxxxxxxxxxxxxx>
      Date: Sun, 8 Aug 2004 09:12:28 -0500
      Content-Type: text/plain;
	      charset="iso-8859-1"
      X-Priority: 3
      X-MSMail-Priority: Normal
      X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
      X-OriginalArrivalTime: 08 Aug 2004 14:12:53.0981 (UTC) FILETIME=[CBE4D0D0:01C47D51]

      >From my experience, Java is about 30% slower than C++ running in byte-code
      mode. However, if compiled Java program into native executables (not the
      simple exe wrapper), the gap is only at about 10%. Comparing the computer
      speed increase is much more than 10% in half year, and programming
      efficiency using Java is at least 30% higher than C++, write GO program in
      Java is a better choise than in C++.

      Weimin

      ----- Original Message ----- 
      From: "Don Dailey" <drd@xxxxxxxxxxxxxxxxx>
      To: <computer-go@xxxxxxxxxxxxxxxxx>
      Cc: <computer-go@xxxxxxxxxxxxxxxxx>
      Sent: Sunday, August 08, 2004 7:41 AM
      Subject: Re: [computer-go] Score estimating



      Chrilly,

      I'm no  expert on  this but I  think speed  is always critical  in any
      game.  Speed and memory are  to computers what intelligence is to man.
      ..
      I think what you  are seeing with Java is not that  it is suited to go
      programming, it's just very popular.  It's not particularly expressive
      OR fast, but it's a good  compromise in both directions.
      ..

      - Don

   _______________________________________________
   computer-go mailing list
   computer-go@xxxxxxxxxxxxxxxxx
   http://www.computer-go.org/mailman/listinfo/computer-go/

_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/