Re: Rob: Bug with Windows trasking translator

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

Robert Craig wrote:

> I found out something surprising today.
> Because of the tasksort.ex demo, I was led to believe
> that OW 1.4 was over 5x faster on DOS graphics, namely
> drawing line segments. I now see that this is not true.
> Actually, the difference is in the cost of executing 
> the time() function (inside the task scheduler).
> I was fooled because Euphoria's time() function speeds
> up tremendously (factor of 100) when "with profile_time" 
> is in effect. In that situation, I handle hardware clock interrupts
> myself, instead of relying on a call to DOS. The profile_time
> showed over 95% of the time being spent drawing line segments,
> so I assumed OW 1.4 must be *much* faster at doing that.
> Actually, in the normal case, with no profile_time, the scheduler, 
> which calls time(), takes a very large chunk of the time.
> Although, even in the worst case, time() requires less than a millisecond
> to execute, it adds up quickly when you are yielding every few statements,
> as in the tasksort demo.
> 
> I also confirmed this by trying the wire.ex demo, which
> doesn't use multitasking. It ran at the same speed, 10.6 or OW.
> It displays lots of line segments at various angles.
> 
> I don't know why moving the mouse speeds up the time() function,
> but both involve hardware interrupts.
> 
> As a result of all this, I went through task_yield() and the scheduler,
> and minimized the number of calls to time(). Now there is always
> just one call, instead of two or three. tasksort now runs twice as fast
> with 10.6.
> 
> I could *always* use the interrupt handling method, instead of
> calling the DOS time function, but I found XP seems to miss some
> interrupts, and the time can be off by 10% or so. This didn't
> happen on the earlier systems. Also, there might be a problem
> on some systems, if your program crashes (due to a hardware exception), 
> while clock interrupt handling has been altered. Your time might 
> advance too slow or too fast, at least under DOS.
> 
> Anyway, on Windows, Linux and FreeBSD this is not an issue
> since time() is very fast.
> 
> Regards,
>    Rob Craig
>    Rapid Deployment Software
>    <a href="http://www.RapidEuphoria.com">http://www.RapidEuphoria.com</a>

Thats just amazing!

Did you know "tick_rate(>= 18.3)" also speeds it up drastically?

tick_rate() and profile_time are my new best friends. smile

I also noticed when it's going that fast, moving the mouse doesn't have any
affect on speed any longer.

BTW, I tested the performance of your newly compiled interpreters. I done
sequence, sieve, and other benchmarks and it concludes a generous speed up in
overall execution. But now you've also kicked up DOS graphics 2x faster, that can
easily be sped up to 6x faster using one of the two methods above.

These are very impressive results and defiently a great performance gain for
Euphoria v3.0! Way to go friend!

Are you planning to upload new executables to the archive once again?


Regards,
Vincent

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

Search



Quick Links

User menu

Not signed in.

Misc Menu