Rob: Verne Tice's High Resolution Timing routines

new topic     » topic index » view thread      » older message » newer message

Great News: I found a "patch" solution to time()'s performance issues!
I feel so relieved now! smile

Not only does Verne's library offer a high resolution time(), but also
out-performs Euphoria v2.5 time() and is even faster than v1.2 on DOS and about
25% faster on Windows. I made some minor optimizations (which sped up hrtime()
even more), and added memory deallocation routines to his library. I couldn't
test it on Linux or FreeBSD, but I imagine the performance would be much improved
too.

Not that you're is interested, but I thought I'd share the results. smile:

Sequence operations:
* v1.2 'EX.exe' has slightly faster slicing than v2.5 'EX.exe' w/ hrtime().
* v2.5 'EX.exe' w/ hrtime() performs 2x faster appending than v1.2 'EX.exe'.
* v2.5 'EX.exe' w/ hrtime() beats v1.2 'EX.exe' by a fair margin in all other
sequence tests.
* On Windows hrtime() is about 25% faster than regular time() on most
benchmarks, but is still beaten slightly by v1.2 'EX.exe' in 3 out of 5 sequence
tests (it's a close though, and the other 2 are faster).

Old Sieve:
* v2.5 'EX.exe' w/ hrtime() is ~1.622x faster than normal v2.5 time().
* v2.5 'EX.exe' w/ hrtime() is about 5-10% faster than v1.2 time().
* v2.5 'EXW.exe' w/ hrtime() is the same speed as normal v2.5 time().

New Sieve:
The newer sieve benchmark was designed better with very little reliance on
time() in determinding results. Both time() and hrtime() perform equally well on
both DOS & Windows; both of which are faster than v1.2 time().


The problem is the library uses the RDTSC CPU instruction, which is only
available in Pentium & K6 class CPUs and newer. So if you have a 386 or 486, your
out of luck and would have stick with normal time().

Another problem is if the CPU has dynamic clock frequency adjustment technology
(speed-step, etc.), it would have to be disabled in the BIOS first; otherwise you
could get unreliable timing results or worse.

These issues will probably prevent you from ever implementing this sort of thing
in the official Euphoria interpreters, but you should still mention this library
in the time() comment paragraph, in the reference manual.


Regards,
Vincent

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu