1. Computer language shootout

So far I'm doing all of the benchmarks in order and it seems as if they 
get harder as you go down the list.  I'm only skipping the dispatch 
benchmark for now because I want to understand it better and I want to 
write it only in Euphoria -- without using any external OO libraries.

Plus I don't understand state machines very well but I think it can be done.

http://shootout.alioth.debian.org/

When I am done I want to compare Euphoria 2.4 with Euphoria 2.5, 
Euphoria 2.5 translated, Euphoria 2.5 interpreter translated, and 
Euphoria 2.5 double interpreted (eu.ex).

I plan on using some standard program, like maybe a C version of wc, as 
a standard timing reference to compare against so that most machine 
differences can be discounted.  The same reference should be able to be 
used on Linux so that all tests have a standard time to reference against.

Since I'm using windows XP I should also write a testing framework in 
Euphoria like the shootout website uses Perl in order to test all the 
programs (once they're written) and record the results.

I don't know how I'll record the memory usage though.

-- 
==============================
Too many freaks, not enough circuses.
j.

new topic     » topic index » view message » categorize

2. Re: Computer language shootout

Jason Gade wrote:
> 
> So far I'm doing all of the benchmarks in order and it seems as if they 
> get harder as you go down the list.  I'm only skipping the dispatch 
> benchmark for now because I want to understand it better and I want to 
> write it only in Euphoria -- without using any external OO libraries.
> 
> Plus I don't understand state machines very well but I think it can be done.
> 
> <a
> href="http://shootout.alioth.debian.org/">http://shootout.alioth.debian.org/</a>
> 
> When I am done I want to compare Euphoria 2.4 with Euphoria 2.5, 
> Euphoria 2.5 translated, Euphoria 2.5 interpreter translated, and 
> Euphoria 2.5 double interpreted (eu.ex).
> 
> I plan on using some standard program, like maybe a C version of wc, as 
> a standard timing reference to compare against so that most machine 
> differences can be discounted.  The same reference should be able to be 
> used on Linux so that all tests have a standard time to reference against.
> 
> Since I'm using windows XP I should also write a testing framework in 
> Euphoria like the shootout website uses Perl in order to test all the 
> programs (once they're written) and record the results.
> 
> I don't know how I'll record the memory usage though.
> 
> -- 
> ==============================
> Too many freaks, not enough circuses.
> j.
> 
> 

Also submit them to the shootout, and see how they compare to all those other
languages. Prime sieve just isnt good enough... Doing this will give everyone a
complete idea on Euphoria's overall performance. Although it wont compare to like
PureBasic, ASM, or C/C++.. The results may or may not be suprizing. :P

This should be interesting, I look forward to the results.

Thanks,
Vincent

      \::\'\      //::/  |::|  \::\\ |'|::|
       \::\'\    //::/   |::|   \::\\|'|::|
        \::\'\__//::/    |::|    \::\|'|::|
         \::\','/::/     |::|     \::\\|::|
          \::\_/::/      |::|      \::\|::|
           \::,::/       |::|       \:::::|
            \___/        |__|        \____|

 	                 .``.
		         ',,'

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

3. Re: Computer language shootout

Vincent wrote:
> 
> Also submit them to the shootout, and see how they compare to all those other
> languages.
> Prime sieve just isnt good enough... Doing this will give everyone a complete
> idea
> on Euphoria's overall performance. Although it wont compare to like PureBasic,
> ASM,
> or C/C++.. The results may or may not be suprizing. :P
> 
> This should be interesting, I look forward to the results.
> 
> Thanks,
> Vincent
> 
>       \::\'\      //::/  |::|  \::\\ |'|::|
>        \::\'\    //::/   |::|   \::\\|'|::|
>         \::\'\__//::/    |::|    \::\|'|::|
>          \::\','/::/     |::|     \::\\|::|
>           \::\_/::/      |::|      \::\|::|
>            \::,::/       |::|       \:::::|
>             \___/        |__|        \____|
> 
>  	                 .``.
> 		         ',,'
> 

I might submit them to the shootout, but with their license restrictions and the
fact that I'm using Windows instead of Linux may prevent it from being accepted.

Then again by the time the project is finished I might be using Linux again. 
I've used it off and on for 9 years now.  I've got space on my "main" computer to
install it, just haven't taken the time.  Heck, downloading Linux is one of the
main reasons I'm paying for high-speed internet.

The other problem is that at home I usually use my laptop which I do not plan on
installing Linux on.  At least not yet.  Of course I should probably use a live
CD and keep the files on my thumb drive or something...  Still just lazy I guess.
 I usually find my time taken up by stuff like constantly checking this list to
see if there is anything new!  blink


=====================================
Too many freaks, not enough circuses.

j.

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

4. Re: Computer language shootout

Jason Gade wrote:
> 
> Vincent wrote:
> > 
> > Also submit them to the shootout, and see how they compare to all those
> > other languages.
> > Prime sieve just isnt good enough... Doing this will give everyone a
> > complete idea
> > on Euphoria's overall performance. Although it wont compare to like
> > PureBasic, ASM,
> > or C/C++.. The results may or may not be suprizing. :P
> > 
> > This should be interesting, I look forward to the results.
> > 
> 
> I might submit them to the shootout, but with their license restrictions and
> the fact
> that I'm using Windows instead of Linux may prevent it from being accepted.
> 
> Then again by the time the project is finished I might be using Linux again. 
> I've
> used it off and on for 9 years now.  I've got space on my "main" computer to
> install
> it, just haven't taken the time.  Heck, downloading Linux is one of the main
> reasons
> I'm paying for high-speed internet.
> 
> The other problem is that at home I usually use my laptop which I do not plan
> on installing
> Linux on.  At least not yet.  Of course I should probably use a live CD and
> keep the
> files on my thumb drive or something...  Still just lazy I guess.  I usually
> find my
> time taken up by stuff like constantly checking this list to see if there is
> anything
> new!  blink
> 
> 
> =====================================
> Too many freaks, not enough circuses.
> 
> j.
> 

Well you might try calculating the benchmarks yourself.

http://shootout.alioth.debian.org/great/benchmark.php?test=all&lang=all&sort=fullcpu

There really is no point in doing all this if your not going to compare it to
all those languages.

Regards,
Vincent

----------------------------------------------
     ___	      __________      ___
    /__/\            /__________\    |\ _\
    \::\'\          //::::::::::\\   |'|::|
     \::\'\        //:::_::::_:::\\  |'|::|
      \::\'\      //::/  |::|  \::\\ |'|::|
       \::\'\    //::/   |::|   \::\\|'|::|
        \::\'\__//::/    |::|    \::\|'|::|
         \::\','/::/     |::|     \::\\|::|
          \::\_/::/      |::|      \::\|::|
           \::,::/       |::|       \:::::|
            \___/        |__|        \____|

 	                 .``.
		         ',,'

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

5. Computer language shootout

I've updated the computer language shootout files. They should be on the website
pretty soon.

I've added the fasta, sumfile, and mandelbrot benchmarks. The fasta benchmark
will be important because its output is important for implementing some of the
other benchmarks.

I need to make a table showing what I've implemented, and whether it is current,
deprecated, or classic. If I keep working on this project, I'll make subfolders
showing this.

If anyone can test these on Linux, that would be appreciated.

Also if anyone has any performance tips I could use those as well. I've tried to
keep a good balance between using Euphoria features and going for the fastest
code I know how to make. But most of the files are copied almost verbatim from C
or another language.

During the testing of the mandelbrot program, I also wrote a tool to help me
check the binary output of my program. It is called bin2hex. Instead of using a
hex editor, I wrote this quick one-off program so I could convert a binary file
to text and be able to open it in my favorite editor (Edita, of course!)

Whoever voted 0.5 microeconomy dollars to the Computer Language Shootout
project, thanks! It renewed my interest in it.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

6. Re: Computer language shootout

Linux:

nsieve.ex:50
m has not been declared
    printf(1, "Primes up to %8d %8d\n", {m, NSieve(10000 * power(2, n))})

I didn't see any other problems.  Thanks for implementing the shootout
in Euphoria.

Ken Rhodes
100% MicroSoft Free
SuSE Linux 10.0
No AddWare, SpyWare, or Viruses!
Life is Good  smile

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

7. Re: Computer language shootout

Jason Gade wrote:
> 
> I've updated the computer language shootout files. They should be on the
> website
> pretty soon.
> 
> I've added the fasta, sumfile, and mandelbrot benchmarks. The fasta benchmark
> will be important because its output is important for implementing some of the
> other benchmarks.
> 
> I need to make a table showing what I've implemented, and whether it is
> current,
> deprecated, or classic. If I keep working on this project, I'll make
> subfolders
> showing this.
> 
> If anyone can test these on Linux, that would be appreciated.
> 
> Also if anyone has any performance tips I could use those as well. I've tried
> to keep a good balance between using Euphoria features and going for the
> fastest
> code I know how to make. But most of the files are copied almost verbatim from
> C or another language.
> 
> During the testing of the mandelbrot program, I also wrote a tool to help me
> check the binary output of my program. It is called bin2hex. Instead of using
> a hex editor, I wrote this quick one-off program so I could convert a binary
> file to text and be able to open it in my favorite editor (Edita, of course!)
> 
> Whoever voted 0.5 microeconomy dollars to the Computer Language Shootout
> project,
> thanks! It renewed my interest in it.
> 
> --
> "Any programming problem can be solved by adding a level of indirection."
> --anonymous
> "Any performance problem can be solved by removing a level of indirection."
> --M. Haertel
> j.

Have you done any testing against other languages using these benchmarks? Can
you send these to the shootout and have them rank Euphoria among the other
languages? Or do they only accept fully open-source languages? Euphoria is
partially open-source, does that count any?

I'm guessing it would rank pretty high (so long the majority of the benchamrk
programs function). It would be interesting to see exactly how well Euphoria
compares to C, C++, C#, D, and Java.

You should ask and see if they will accept your entry.


Regards,
Vincent

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

8. Re: Computer language shootout

Kenneth Rhodes wrote:
> 
> Linux:
> 
> nsieve.ex:50
> m has not been declared
>     printf(1, "Primes up to %8d %8d\n", {m, NSieve(10000 * power(2, n))})
> 
> I didn't see any other problems.  Thanks for implementing the shootout
> in Euphoria.
> 
> Ken Rhodes
> 100% MicroSoft Free
> SuSE Linux 10.0
> No AddWare, SpyWare, or Viruses!
> Life is Good  smile

Yeah, I discovered this today by accident after I had updated. I "accidently"
executed the file while in Edita.

I did a lot of editing to change some input routines and comments, but I should
have checked it more carefully. I'll fix it soon.

I'm working on the nbody problem right now. I keep hoping to find a way to
leverage sequences in these benchmarks, but so far only binary-trees has shown
any promise. For nbody, I'm going to implement the C version first, and then see
if I can make any sequence operation optimizations.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

9. Re: Computer language shootout

Vincent wrote:
> Have you done any testing against other languages using these benchmarks?

I haven't compared to other languages yet, it is on my to-do list. From my rough
estimates, it is in the top 1/3 or 1/5 of languages in most cases. It compares
very well to other interpreted languages. Right now this is just measured with
the built-in time() function though, and not really taking into account computer
speed differences. Just very rough estimates.

I need to check their CVS site and see if I can get their perl framework for
testing, or write my own in Euphoria, and test it under Linux. I plan on using
the C version of some program (maybe nsieve?) as my unit of measurement. That
way, things can be rated according to a fixed scale regardless of computer speed
or compiler options.

> Can you send these to the shootout and have them rank Euphoria among the other
> languages? Or do they only accept fully open-source languages? Euphoria > is
> partially open-source, does that count any?

I don't know yet. I haven't submitted and I'm not sure if I will. I may just try
to recreate some of the other language benchmarks on my own machine and compare
them.

Someone made a debian install for Euphoria, which is one of the criteria for an
official entry. Another criterion is that the language should be open source.

While I have argued in the past that Euphoria is practically open source, it
really isn't. It is *free*, though, if you find a way to implement your own back
end. But eu.ex requires either the free and public domain (but not open source)
interpreter or it needs to be translated which includes a non-open-source (but
free, I think) library.

(This is not an argument for or against, I would prefer open source but I'm not
opposed to the status quo.)

("free" above refers to the fact that most of Euphoria has been given to the
public domain, open-source or not.)

> I'm guessing it would rank pretty high (so long the majority of the benchamrk
> programs function). It would be interesting to see exactly how well Euphoria
> compares to C, C++, C#, D, and Java.
> 
> You should ask and see if they will accept your entry.
> 
> 
> Regards,
> Vincent

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

10. Re: Computer language shootout

Jason,

I noticed in the fasta code:


function selectRandom(sequence genelist)
    
--  C version uses binary search, this works better than find().
    integer ix, lo, hi
    atom r
    
    r = gen_random(1)
    lo = 1
    hi = length(genelist)
    
    if r < genelist[1] then return CODES[1] end if
    
    while hi > lo + 1 do
        ix = floor((hi + lo) / 2)
        if r < genelist[ix] then hi = ix
        else lo = ix
        end if
    end while
    
    return CODES[hi]
    
end function -- selectRandom

Can this euphoria code be of use?

global function bfind(object x, sequence s)
-- does a binary search on a sorted sequence
-- returns index location if found, 0 if not
-- assumes that sequence s has been sorted prior to this call
-- Gabriel Boehme's code
-- Earlier Joe Otto's routine is almost identical.
integer lo, hi, mid, c
   lo = 1
   hi = length(s)

   while lo <= hi do
      mid = floor((lo + hi) / 2)
      c = compare(x, s[mid])
      if    c < 0 then  -- x < s[mid]
         hi = mid - 1
      elsif c > 0 then  -- x > s[mid]
         lo = mid + 1
      else              -- x = s[mid]
         return mid
      end if
   end while

   return 0
end function
Ken Rhodes
100% MicroSoft Free
SuSE Linux 10.0
No AddWare, SpyWare, or Viruses!
Life is Good  smile

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

11. Re: Computer language shootout

Kenneth Rhodes wrote:
> 
> Jason,
> 
> I noticed in the fasta code:
> 
> 
> function selectRandom(sequence genelist)
>     
> --  C version uses binary search, this works better than find().
>     integer ix, lo, hi
>     atom r
>     
>     r = gen_random(1)
>     lo = 1
>     hi = length(genelist)
>     
>     if r < genelist[1] then return CODES[1] end if
>     
>     while hi > lo + 1 do
>         ix = floor((hi + lo) / 2)
>         if r < genelist[ix] then hi = ix
>         else lo = ix
>         end if
>     end while
>     
>     return CODES[hi]
>     
> end function -- selectRandom
> 
> Can this euphoria code be of use?
> 
> global function bfind(object x, sequence s)
> -- does a binary search on a sorted sequence
> -- returns index location if found, 0 if not
> -- assumes that sequence s has been sorted prior to this call
> -- Gabriel Boehme's code
> -- Earlier Joe Otto's routine is almost identical.
> integer lo, hi, mid, c
>    lo = 1
>    hi = length(s)
> 
>    while lo <= hi do
>       mid = floor((lo + hi) / 2)
>       c = compare(x, s[mid])
>       if    c < 0 then  -- x < s[mid]
>          hi = mid - 1
>       elsif c > 0 then  -- x > s[mid]
>          lo = mid + 1
>       else              -- x = s[mid]
>          return mid
>       end if
>    end while
> 
>    return 0
> end function
> Ken Rhodes
> 100% MicroSoft Free
> SuSE Linux 10.0
> No AddWare, SpyWare, or Viruses!
> Life is Good  smile

I don't know, I'll have to try it. I basically copied the existing selectRandom
code verbatim from the C version.

I had tried to use the following instead:
return CODES[find(TRUE, gen_random(1) < genelist)]


as the entire function body. I found that it was *slightly* slower so I
discarded it. Because the sequence is naturally sorted because it is cumulative,
I used the C version of binary search.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

12. Re: Computer language shootout

I didn't find Open Source to be a requirement.

They mention languages:

Must have

1) A Debian package (either from Debian itself, or the primary authors of the
   language) or a Gentoo ebuild or build and install with ./configure && make &&
   make install and a default target of /usr/local.
   2) Command-line argument handling. 
   3) 32-bit Integers. 
   4) Double precision floating point numbers. 
   5) Line-oriented read & write from stdin & stdout. 
   6) Documentation. 

Should have

   1) Buffered stdio. 
   2) Dynamic hash tables and sequences (arrays or lists). 
   3) Exception handling. 
   4) Regular Expressions (preferably Perl compatible). 
   5) Concurrency (threads, coroutines, …) 
   6) TCP/IP Sockets. 

Also, they compare }}}
<eucode>same algorithms</eucode>
{{{
 and not only same results.
So programs providing same results through different algorithms may be rejected.

Last but not least, they clearly state that they will accept and reject
languages in a capricious, unfair, biased fashion.
 
JG

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

13. Re: Computer language shootout

Julio C. Galaret Viera wrote:
> 
> I didn't find Open Source to be a requirement.

I could swear that they did... maybe they changed it (or I'm remembering wrong!)

> They mention languages:
> 
> Must have
> 
>    1) A Debian package (either from Debian itself, or the primary authors of
>    the
> language) or a Gentoo ebuild or build and install with ./configure && make
> && make install and a default target of /usr/local. 

Check.

>    2) Command-line argument handling. 

Check.

>    3) 32-bit Integers.

This one is a killer, but they would probably make an exception.

>    4) Double precision floating point numbers. 
>    5) Line-oriented read & write from stdin & stdout. 
>    6) Documentation. 

All good.

> Should have
> 
>    1) Buffered stdio. 
>    2) Dynamic hash tables and sequences (arrays or lists). 
>    3) Exception handling. 
>    4) Regular Expressions (preferably Perl compatible). 
>    5) Concurrency (threads, coroutines, …) 
>    6) TCP/IP Sockets. 
> 
> Also, they compare }}}
<eucode>same algorithms</eucode>
{{{
 and
> not </font><font color="#330033">only same results. So programs providing  >
> same results through different algorithms may be rejected.</font>

I have been practically copying the existing submissions verbatim, although I
*am* getting better...

> 
> Last but not least, they clearly state that they will accept and reject
> languages
> in a capricious, unfair, biased fashion.
>  
> JG


--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

14. Re: Computer language shootout

Jason Gade wrote:
> 
> Julio C. Galaret Viera wrote:
> > 
> > I didn't find Open Source to be a requirement.
> 
> I could swear that they did... maybe they changed it (or I'm remembering
> wrong!)
> 
> > They mention languages:
> > 
> > Must have
> > 
> >    1) A Debian package (either from Debian itself, or the primary authors of
> >    the
> > language) or a Gentoo ebuild or build and install with ./configure && make
> > && make install and a default target of /usr/local. 
> 
> Check.

I don't see a Debian package on the Euphoria download page?

I know someone did one, but if it's not from the official source I'm not sure
that would count.

Gary

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

15. Re: Computer language shootout

ags wrote:
> 
>
> I don't see a Debian package on the Euphoria download page?
> 
> I know someone did one, but if it's not from the official source 
>  I'm not sure that would count.
> 
> Gary

http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=Debian



Ken Rhodes
100% MicroSoft Free
SuSE Linux 10.0
No AddWare, SpyWare, or Viruses!
Life is Good  smile

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

16. Re: Computer language shootout

Kenneth Rhodes wrote:
> 
> Linux:
> 
> nsieve.ex:50
> m has not been declared
>     printf(1, "Primes up to %8d %8d\n", {m, NSieve(10000 * power(2, n))})
> 
> I didn't see any other problems.  Thanks for implementing the shootout
> in Euphoria.

Fixed it. I had eliminated m as a global variable, but forgot to re-declare it
as a local. A few other minor bugs came up as well, mainly attention to details.

Let me know if there are any other problems.

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

17. Computer language shootout

Okay, last night I fixed the nsieve error but I uploaded older versions of all
the rest of the files. It should be fixed now, everything should be current. Plus
I added the nbody benchmark, but I'm still going to work on that to see if I can
leverage the use of sequences better.

And hopefully I can stop updating it daily smile

--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu