Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > Some Sather benchmarks
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 13th November 03:28
obliviemo
External User
 
Posts: 1
Default Some Sather benchmarks



Language benchmarks: some relative results according to /usr/bin/time.

Doug Bagley (I forget, try google) had a project of collecting little
benchmarks for programming languages. It didn't include Sather, and
he eventually lost interest. But recently noticing his site I have


a grain of salt) for a few. They may mean something in relative
terms. I think I have correctly used the relevant optimizing switches
for each compiler.

+--------------------------+
| Times for hash2 (sec) |
+--------------------------+
| Ocaml 3.18 |
| C 3.49 |
| Sather 5.56 |
| C++ 6.48 |
| Java 8.04 |
| SmallEiffel 8.45 |
+--------------------------+


+--------------------------+
| Times for lists1 (sec) |
+--------------------------+
| C 0.34 |
| Sather 0.37 |
| Ocaml 1.47 |
| Java 2.58 |
| C++ (couldn't compile) |
| SmallEiffel (not there) |
+--------------------------+

G++ wanted iota, what I wot not of. There was no SmallEiffel program
for this test at the site.


+--------------------------+
| Times for random (sec) |
+--------------------------+
| C-fixed 0.133 |
| Sather 0.136 |
| C 0.180 |
| C++ 0.330 |
| SmallEiffel 0.334 |
| Ocaml 0.363 |
| Java 1.359 |
+--------------------------+

C-fixed is the C program modified to not gratuitously use mixed
integer and real types in an expression. The programmer apparently
overlooked the difference between integral and integer. The fact that
Sather outperformed C drew attention to the problem with the C
program.

The C language encourages mistakes of this kind. It is compulsory for
C programmers to use super whacko preprocessor macros where other
languages would have program statements.

To deliberately create such barbarous expressions just to play along
would be hell for a Sather programmer (***bersome ******** type
conversions in mixed expressions) and misses the (claimed) point of
the benchmark, which is not to test the speed of conversion of values
out of types they shouldn't be in, but something else. The results
for the other languages would be improved (I don't know how much) if
they had not followed the C version.

The changes from C to C-fixed are:

-#define IM 139968
-#define IA 3877
-#define IC 29573
+double IM = 139968.0;
+double IA = 3877.0;
+double IC = 29573.0;

inline double gen_random(double max) {
- static long last = 42;
- last = (last * IA + IC) % IM;
+ static double last = 42.0;
+ last = fmod((last * IA + IC), IM);
return( max * last / IM );
}


+--------------------------+
| Times for matrix (sec) |
+--------------------------+
| C 0.165 |
| C++ 0.253 |
| Sather 0.368 |
| Ocaml 0.497 |
| Java 0.861 |
| SmallEiffel 1.401 |
+--------------------------+


+--------------------------+
| Times for ary3 (sec) |
+--------------------------+
| SmallEiffel \ |
| C | 10.2 |
| C++ | |
| Sather / |
| Ocaml 11.5 |
| Java 12.5 |
+--------------------------+

The times seemed highly variable for this test, and I couldn't clearly
separate the first four, but my subjective impression was as above,
with SmallEiffel a short nose ahead.


+--------------------------+
| Times for strcat (sec) |
+--------------------------+
| C 0.026 |
| SmallEiffel 0.038 |
| Ocaml 0.040 |
| Sather 0.056 |
| C++ 0.073 |
| Java 0.352 |
+--------------------------+


+--------------------------+
| Times for ackermann (sec)|
+--------------------------+
| Ocaml 0.081 |
| Sather 0.209 |
| C 0.212 |
| C++ 0.227 |
| SmallEiffel 0.331 |
| Java 0.750 |
+--------------------------+


+--------------------------+
| Times for fibo (sec) |
+--------------------------+
| Ocaml 0.350 |
| C 0.521 |
| C++ 0.525 |
| SmallEiffel 0.525 |
| Sather 0.585 |
| Java 1.308 |
+--------------------------+

Source for all but Sather is at Doug Bagley's site. If you would like
to see my Sather code send e-mail to userid mtw on the host calypso in
the domain view period net adding the country code for Australia.
  Reply With Quote


  sponsored links


2 13th November 03:30
piotr5
External User
 
Posts: 1
Default Some Sather benchmarks



In article <slrnbgj69q.mkb.obliviemo@calypso.view.net.au>,
obliviemo@calypso.view.net.au (Mikelo Obliviemo) writes:


but which version of sather, and which version of c?
--
Better send the eMails to netscape.net, as to
evade useless burthening of my provider's /dev/null...

before complaining because of my rudeness, read
http://www.unet.univie.ac.at/~a9702387/en/adl/liar-faq.txt
and killfile me...

P
  Reply With Quote
3 13th November 03:30
igouy
External User
 
Posts: 1
Default Some Sather benchmarks


Aldo Calpini ported them to "The Great Win32 Computer Language
Shootout" and very occasionally updates the site with additional
languages.

http://dada.perl.it/shootout/

If you provide Aldo with Sather implementations he may someday add
them to the shootout website. Note: don't expect a reply to any emails
you send, and don't expect your contribution to be added real-soon.

Helps if you give complete instructions on where to download the
compiler from, how to compile the code, how to run the code. Separate
the files into directories like:

\bench
\ackermann
ackermann.sather_extension
\ary3
ary3.sather_extension

best wishes, Isaac
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666