1. Oh no, another Euphoria vs. C comparison

--------------68FB5D9928E3F5517EC00273

Hello everyone,

I'm sorry for being late about this; I only read last week's messages
today. Anyway, after reading a message saying Euphoria is over 200 times
slower than C, I decided to compare their speeds using something closer
to real world programming than empty loops or any such thing.

I found an Euphoria implementation of a simple (?) algorithm somewhere
in my HD, modified it a bit and wrote a similar C program, which was
compiled with the Borland C++ compiler (version 5.2), using the
"Optimize for speed" option. The programs were run in my Pentium II-233,
running Win98.

So here are my results. The comparison does not consider many aspects of
the languages, but may give an idea of their relative speeds. I am not a
C expert, so maybe the C version could be made somewhat faster, but I
think it will not be a big difference.

The result: on average, the C version was about 6 times faster than the
Euphoria one.

I have included both versions, along with the program I used to
benchmark them. If you want to get better results, try to optimize both
the C and Euphoria versions, run them on different platforms, test
different C compilers (I tried using DJGPP and it was 5.3 times faster
then Euphoria) ...

Rob, would it be possible for you to compile the Euphoria version and
tell us how it compares to the others? I am curious!

Regards,
Davi Figueiredo
davitf at usa.net
--------------68FB5D9928E3F5517EC00273
 name="bench.zip"

new topic     » topic index » view message » categorize

2. Re: Oh no, another Euphoria vs. C comparison

Davi Figueiredo writes:

> Rob, would it be possible for you to compile the
> Euphoria version and tell us how it compares to the others?
> I am curious!

When I translate test.ex to C and compile it with WATCOM,
it runs 2.54x faster than when it's interpreted. There are
several places where more optimization of the generated
C is possible, but I want to get a release out before looking
into it.

If you run a time profile on test.ex you should find that
the statement involving xor_bits() and and_bits()
is the biggest time-consumer at about 45% of the
total execution time. The call to and_bits() is not
present in the C version, because the C program
can fortunately take advantage of chars
overflowing at 8 bits.

Another thing that's a bit suspect about the C vs.
interpreter benchmark is that you are including the time for:
      1. loading and decompressing the (relatively large)
          Euphoria interpreter
      2. parsing the entire Euphoria program.
whereas the (relatively small) C program starts
immediately to perform the benchmark task.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu