Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FB DOS faster than FB Windows?
#1
According to my tests, FB 0.13b for DOS seems faster than FB 0.13b for Windows.

Here are the results of my test program:

Code:
' Time in seconds to evaluate 1,000,000 functions
' Some functions are built-in functions. They have their usual names
' Other functions are taken from my library
' ------------------------------------------------------------------

       Windows      DOS
Log       0.26     0.05
Ln        0.29     0.11
Log10     0.29     0.11
Log2      0.29     0.11
Exp       0.18     0.11
Expo      0.2      0.16
Exp10     0.21     0.17
Exp2      0.2      0.16
^ (power) 0.23     0.22
Sin       0.26     0.06
Cos       0.27     0.11
Tan       0.28     0.11
ASin      0.19     0.11
ACos      0.19     0.11
Atn       0.27     0.11
Atan2     0.22     0.11
Sinh      0.2      0.16
Cosh      0.21     0.17
Tanh      0.25     0.22
ASinh     0.38     0.11
ACosh     0.38     0.11
ATanh     0.3      0.11
Gamma     0.33     0.28
IGamma    1.42     0.93
Beta      1.6      0.99
IBeta     6.28     4.23
Erf       1.37     0.93
Erfc      1.37     0.88
RND       0.02     0.06
RanMWC    0.12     0.11

Tested on a P4, 3 GHz, Windows XP SP2

FB DOS was tested from a DOS box in Windows, not from plain DOS.
ean Debord
----------------
Math library for FreeBasic:
http://www.unilim.fr/pages_perso/jean.de...fbmath.zip
Reply
#2
You're mostly testing stuff that uses the standard C library. Maybe DJGPP has a better runtime library implementation.

Do Windows FB executables link to MS's standard C lib, or to some Windows version of glibc?
Reply
#3
i wonder if any of his test in the windows version of the test is using print anywere window consol is alot slower then dos
Reply
#4
In Windows the M$ VC6 CRT is used, in DOS it's the DjGPP's libc/m.

Did you try with say 10x more interations? The DOS timer has only 55ms of resolution, benchmarks below 1 sec can be imprecise.
Reply
#5
Unless you ran FB DOS in a commadn prompt that would be logical because windows or doing a loads of other hings besides running your prog, unlike DOS which runs very few things.
atos-Software
http://www.datacentertalk.com - interested in how web hosting works? Here the place to go to find out.
[Image: 42-r]
Reply
#6
Quote:In Windows the M$ VC6 CRT is used, in DOS it's the DjGPP's libc/m.

Did you try with say 10x more interations? The DOS timer has only 55ms of resolution, benchmarks below 1 sec can be imprecise.

I have checked 10 times more iterations. All times were multiplied by (roughly) 10 and the differences between the two versions remained.
ean Debord
----------------
Math library for FreeBasic:
http://www.unilim.fr/pages_perso/jean.de...fbmath.zip
Reply
#7
Quote:i wonder if any of his test in the windows version of the test is using print anywere window consol is alot slower then dos

There was no printing inside the loop. All printing was done after TIMER had been called.

The test program (speed.bas) is in my library.
ean Debord
----------------
Math library for FreeBasic:
http://www.unilim.fr/pages_perso/jean.de...fbmath.zip
Reply
#8
I see, M$ didn't care much about the transcendental functions, it seems.. anyways, next version will probably come with SIN, COS and TAN as inline, so the speed will be the same on any OS.

EDIT: Alright, SIN, ASIN, COS, ACOS, TAN, ATN, ATAN2, SQR and LOG are now implemented as inline, this is the result using your speed test:

Code:
Time in seconds to evaluate  1000000 functions

Log      0.13
Sin      0.10
Cos      0.09
Tan      0.11
ASin     0.20
ACos     0.20
Atn      0.14
Atan2    0.19

Using the old non-inlined version:

Code:
Time in seconds to evaluate  1000000 functions

Log      0.24
Sin      0.26
Cos      0.26
Tan      0.24
ASin     0.32
ACos     0.32
Atn      0.26
Atan2    0.32

Both results using the Windows version on a 1.8 Athlon.
Reply
#9
Jark's raytracer will fly!!
Antoni
Reply
#10
This is perfect! Thank you very much!

But, what about the exponential?
ean Debord
----------------
Math library for FreeBasic:
http://www.unilim.fr/pages_perso/jean.de...fbmath.zip
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)