1. Eu vs PowerBasic

Choices of programming languages came up in an irc channel, and PowerBasic was of course mentioned. I had not looked at it in a while, so i re-looked at it. Their little test on

http://www.powerbasic.com/products/pbdll32/default.asp

looked impressive: "On an AMD 64 CPU,.....(WinXP Pro). Same source code, line for line. No attempt to minimize any background tasks. Elapsed time: 0.209 seconds."

So i converted it to Eu, and gave it a try.

    without warning 
    without trace 
    object junk 
    atom x, y, t 
    x = 1 
    y = 1.000001 
for repeatloop = 1 to 10 do     
    t = time() 
    for i = 1 to 100000000 do 
        x = x * y 
    end for 
    t = time() - t 
    puts(1,sprintf("%d",t)&"\n") 
end for     
junk = gets(0) -- whereafter the program terminates 

Running Eu v3.1 and v4.a, i got these numbers for 10 iterations of the code, each number is one iteration, times are in seconds:

v3.1 V4.0.a
5 4
6 4
6 5
6 5
5 5
5 5
6 5
48 44
48 48
48 48

Computer used is a P4 2.4ghz with 1gb of ram, running winxp sp2. Tis a far yelp, cry, scream from their 0.209 seconds. What's going on?

useless

new topic     » topic index » view message » categorize

2. Re: Eu vs PowerBasic

with euphoria 3.1 on inspiron 1501 laptop with ADM athlon 64x2 I get
3 seconds not translated
2 seconds translated

Jacques

useless said...

Choices of programming languages came up in an irc channel, and PowerBasic was of course mentioned. I had not looked at it in a while, so i re-looked at it. Their little test on

http://www.powerbasic.com/products/pbdll32/default.asp

looked impressive: "On an AMD 64 CPU,.....(WinXP Pro). Same source code, line for line. No attempt to minimize any background tasks. Elapsed time: 0.209 seconds."

So i converted it to Eu, and gave it a try.

    without warning 
    without trace 
    object junk 
    atom x, y, t 
    x = 1 
    y = 1.000001 
for repeatloop = 1 to 10 do     
    t = time() 
    for i = 1 to 100000000 do 
        x = x * y 
    end for 
    t = time() - t 
    puts(1,sprintf("%d",t)&"\n") 
end for     
junk = gets(0) -- whereafter the program terminates 

Running Eu v3.1 and v4.a, i got these numbers for 10 iterations of the code, each number is one iteration, times are in seconds:

v3.1 V4.0.a
5 4
6 4
6 5
6 5
5 5
5 5
6 5
48 44
48 48
48 48

Computer used is a P4 2.4ghz with 1gb of ram, running winxp sp2. Tis a far yelp, cry, scream from their 0.209 seconds. What's going on?

useless

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

3. Re: Eu vs PowerBasic

Sorry this is an AMD turion 64x2 at 1.6Ghz and windows xp pro sp3
jacques

useless said...

Choices of programming languages came up in an irc channel, and PowerBasic was of course mentioned. I had not looked at it in a while, so i re-looked at it. Their little test on

http://www.powerbasic.com/products/pbdll32/default.asp

looked impressive: "On an AMD 64 CPU,.....(WinXP Pro). Same source code, line for line. No attempt to minimize any background tasks. Elapsed time: 0.209 seconds."

So i converted it to Eu, and gave it a try.

    without warning 
    without trace 
    object junk 
    atom x, y, t 
    x = 1 
    y = 1.000001 
for repeatloop = 1 to 10 do     
    t = time() 
    for i = 1 to 100000000 do 
        x = x * y 
    end for 
    t = time() - t 
    puts(1,sprintf("%d",t)&"\n") 
end for     
junk = gets(0) -- whereafter the program terminates 

Running Eu v3.1 and v4.a, i got these numbers for 10 iterations of the code, each number is one iteration, times are in seconds:

v3.1 V4.0.a
5 4
6 4
6 5
6 5
5 5
5 5
6 5
48 44
48 48
48 48

Computer used is a P4 2.4ghz with 1gb of ram, running winxp sp2. Tis a far yelp, cry, scream from their 0.209 seconds. What's going on?

useless

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

4. Re: Eu vs PowerBasic

This is a pretty useless benchmark, kinda funny it's even used. I tried to find a trial version of powerbasic so I could do a more helpful benchmark, but they don't offer it, I guess you have to pay the $199 for it. How many times do you loop from 1 to 100000000 doing one calculation? The problem is that the loop is probably optimized out and you have constants so the compiler can easily write the program as:

double x = 2.687982717e+43; print x

For example, I converted the program to C. When running w/no loop optimization, C takes 0.58 seconds. Add in loop optimization, C goes down to 0.031 seconds. It simply optimized the loop.

You are far better off doing a test that does some actual real world work. Since you cannot download power basic as a demo, we cannot run such a test. To claim it's fast because of this loop optimization is pretty lame in my book. Now, should euphoria have such optimizations? Probably. Will it make a 900% difference in real applications? No way.

Jeremy

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

5. Re: Eu vs PowerBasic

Jeremy, any idea why the execution time on v3.1 and v4 exploded to 40+ seconds on the last 3 iterations?

useless

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

6. Re: Eu vs PowerBasic

useless said...

Jeremy, any idea why the execution time on v3.1 and v4 exploded to 40+ seconds on the last 3 iterations?

Hm. No idea but I'm glad you found it. I modified your program slightly:

without type_check 
 
atom x = 1, y = 1.000001, t 
 
for repeatloop = 1 to 10 do      
    t = time() 
 
    for i = 1 to 100000000 do 
        x = x * y  
    end for 
 
    ? time() - t 
end for 

and submitted it as a bug because I get:

2.375 
2.375 
2.36 
2.359 
2.375 
2.375 
2.375 
13.734 
15 
14.985 

Something is obviously not right. http://sourceforge.net/tracker/?func=detail&aid=2804581&group_id=182827&atid=902782

Jeremy

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

7. Re: Eu vs PowerBasic

jeremy said...
useless said...

Jeremy, any idea why the execution time on v3.1 and v4 exploded to 40+ seconds on the last 3 iterations?

Hm. No idea but I'm glad you found it. I modified your program slightly:

without type_check 
 
atom x = 1, y = 1.000001, t 
 
for repeatloop = 1 to 10 do      
    t = time() 
 
    for i = 1 to 100000000 do 
        x = x * y  
    end for 
 
    ? time() - t 
end for 

and submitted it as a bug because I get:

2.375 
2.375 
2.36 
2.359 
2.375 
2.375 
2.375 
13.734 
15 
14.985 

Something is obviously not right. http://sourceforge.net/tracker/?func=detail&aid=2804581&group_id=182827&atid=902782

Jeremy

I tried this program with a slight modification. I printed the value of x after each loop. Since this variable is never reset the value continues to grow after each loop. Sometime during the 8th iteration the value overflowed and produced inf as the value. I suspect that multiplying this value is slower than normal.

Larry

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

8. Re: Eu vs PowerBasic

LarryMiller said...

I tried this program with a slight modification. I printed the value of x after each loop. Since this variable is never reset the value continues to grow after each loop. Sometime during the 8th iteration the value overflowed and produced inf as the value. I suspect that multiplying this value is slower than normal.

Of course... Output is now:

2.344 
2.344 
2.344 
2.328 
2.328 
2.344 
2.343 
2.329 
2.328 
2.328 

Thanks Larry!

Jeremy

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

9. Re: Eu vs PowerBasic

On my intel t5500 1.66gh EU version 2.4

3 2 2 2 2 2

George

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

10. Re: Eu vs PowerBasic

GeorgeWalters said...

On my intel t5500 1.66gh EU version 2.4

3 2 2 2 2 2

George

Instead of using printf(1, "%d"....., I changed it to ? time() - t ... %d converts it to an integer and when timing something as close as 2.345 and 2.228, the extra 3 decimal places helps. For instance, your first is 3.??? and second is 2.999 or ???

Jeremy

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

11. Re: Eu vs PowerBasic

Wow, either my machine is very sick or something weird is going on. I'm getting between 12 and 14 seconds per iteration.

I've got an Intel core2 2.4Ghz with 2Gig RAM.

I tried the same program coded in D and I get 0.48 seconds, and when I coded it in D emulating the Euphoria translator's code I get 1.87 seconds.

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

12. Re: Eu vs PowerBasic

My computer is the same spec as Dereks, running on Linux I get 6.34s and 6.18s translated!

So much for benchmarks.

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

13. Re: Eu vs PowerBasic

Bayes said...

My computer is the same spec as Dereks, running on Linux I get 6.34s and 6.18s translated!

So much for benchmarks.

Wow! I just ran it again, same results. Are you guys running debug versions of eui from SVN? I am running from SVN but not debug builds (if that matters).

C:\Develop\euphoria>cat t.ex 
without type_check 
 
atom x, y = 1.000001, t 
 
for repeatloop = 1 to 10 do 
        x = 1 
        t = time() 
 
        for i = 1 to 100000000 do 
        x = x * y 
    end for 
 
        ? time() - t 
end for 
 
C:\Develop\euphoria>eui -version 
Euphoria Interpreter 4.0.0 development (r2148M) for Windows 
Using Managed Memory 
 
C:\Develop\euphoria>eui t.ex 
2.391 
2.359 
2.343 
2.344 
2.359 
2.36 
2.422 
2.343 
2.344 
2.36 
 
C:\Develop\euphoria>euc -con t.ex 
Translating code, pass: 1 2 3  generating 
Compiling with Watcom 
Compiling 13% init-.c 
Compiling 50% t.c 
Compiling 75% main-.c 
Linking 100% t.exe 
 
To run your project, type t.exe 
 
C:\Develop\euphoria>t.exe 
1.609 
1.516 
1.531 
1.531 
1.516 
1.516 
1.531 
1.516 
1.531 
1.531 

I run a quad core 2.4ghz w/4g ram, but the app never uses more than 900k ram and it's limited to 1 processor.

Jeremy

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

14. Re: Eu vs PowerBasic

DerekParnell said...

Wow, either my machine is very sick or something weird is going on. I'm getting between 12 and 14 seconds per iteration.

I've got an Intel core2 2.4Ghz with 2Gig RAM.

I tried the same program coded in D and I get 0.48 seconds, and when I coded it in D emulating the Euphoria translator's code I get 1.87 seconds.

Please, what is D ? Thanks

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

15. Re: Eu vs PowerBasic

vmars said...

Please, what is D ? Thanks

http://en.wikipedia.org/wiki/D_(programming_language)

Jeremy

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

16. Re: Eu vs PowerBasic

jeremy said...

Are you guys running debug versions of eui from SVN?

No, I'm using 3.1.1

Surely the translated speed should be significantly less?

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

17. Re: Eu vs PowerBasic

I meant time, of course.

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

18. Re: Eu vs PowerBasic

DerekParnell said...

Wow, either my machine is very sick or something weird is going on. I'm getting between 12 and 14 seconds per iteration.

I've got an Intel core2 2.4Ghz with 2Gig RAM.

I tried the same program coded in D and I get 0.48 seconds, and when I coded it in D emulating the Euphoria translator's code I get 1.87 seconds.

Derek, I've noticed you are quite active in D's forum. Could you elaborate why you still prefer EU? (Yes, I think D is superior to EU, quite suprising, eh?) No, I don't want to start another flamewar, probably I won't even answer, I am just curious.

Forked: Message was forked into Eu vs. D.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu