Re: which way is faster?
- From: //\\\\o//\\\\annabee <w@xxxxxxxx>
- Date: Fri, 11 Jan 2008 03:35:29 +0100
På Fri, 11 Jan 2008 02:11:40 +0100, skrev Frank Kotler <fbkotler@xxxxxxxxxxx>:
//\\o//\\annabee wrote:
...Write an app, in dos that floats a 256*256 bitmap across a 32 bit formated, vesa canvas. Then I write one using only GDI. Then we can compare the framerate. It would also be interessting to see for other reasons. I never heard of speed comparisons between dos and windows. (Even I guess they exist).
What are you calling "dos"? A "dos box", it seems to me, can't *possibly* be any faster than Windows, since Windows is providing "fake dos". If we start from "real dos", so we can go into "flat real mode", and use a Linear Frame Buffer instead of "bank-switched" hi-res mode, we can go pretty fast. But Windows has access to "hardware acceleration". No theoretical reason you couldn't do it from dos (AFAIK), but you'd need a routine to detect what card you had, and routines to implement hardware acceleration for as many cards as you'd like to support. This is where Windows has got the jump on us - mfg's provide drivers for Windows, and don't tell *us* squat... If we *did* do it, dos ought to be faster, since it's single-user, single-tasking, unpaged... Timer interrupt every 18th of a second or so, and we can turn that off... I don't think I've ever seen hardware acceleration from dos, though - no idea what it would look like.
Well, I didnt mean "dos", I meant bare metal, eg non windows. (any that is choosen)
As far as I know, GDI does not support hardware. (It does not start DirectX in the
background and use that for the GDI builts. (DirectX takes ~half a second to start the first time).(and GDI builts are too slow that I think it does it by some spesific shortcut to the hardware acceleration - even I am not 100% sure)
When I checked the line APIS against a DIBsection (backbuffer=memory) they was optimized pretty damn well since the books I read about the subject. I was unable to write faster code, until I started playing with the prefetch directive. And the GDI built is roughly as fast as that. But not as fast as hardware. (Maybe Herbert knows better on this).
When it comes to multitasking, I just have to repeat that this is not a problem. Both Windows and Linux uses premptive multitasking which means that you can PRE empt other
processes. It is pictured as rings of priority, where the tasks are linked to each other in each ring, and where no lower ring gets a chance to run, if theres is still work to be done in a higher ring. You can preemt the system, and steal near all cycles to yourself. I provided a demonstration here earlier, where a GDI app, can prempt both the mouse and keyboard messages, and keep going. Not very useful, but possible.
The reason I guess why some ppl dont think that it works that way, is that windows is a eventdriven os. That means that until your app gets some kind of message, it is simply a dead piece of memory, doing nothing. But, having a timeslice, and been given a message,
(its not enough to just have a timeslice) - you can set your app at a realtime priority, and call peekmessage instead of getmessage. Peekmessage is not blocking, and so you can continue running the app, after it returns, and with the full priority, you will receive all the timeslices for the ring. And with that you can totally preempt the system, leaving your app, the only survivor. Even the system reads and takes cares of priority interrupts, it will not be able to send you any messages. But you will have the slices, and you app will "work". Basically at this point you can start DirectInput, and read the keyboardbuffer directly, to see if there are keys beeing pressed...(not tested) etc.
(This is some guesswork, and some observation and some of the material from the SDK).
If hardware acceleration were "outlawed" in the Windows version, I think dos could be made to go faster, just from the lack of "competetion".
Thats what I like to find out.
It could be interessting to see the diffrence, if any.
Best,
Frank
.
- References:
- which way is faster?
- From: shikamuk
- Re: which way is faster?
- From: Wolfgang Kern
- Re: which way is faster?
- From: //\\\\o//\\\\annabee
- Re: which way is faster?
- From: Wolfgang Kern
- Re: which way is faster?
- From: //\\\\o//\\\\annabee
- Re: which way is faster?
- From: Wolfgang Kern
- Re: which way is faster?
- From: //\\\\o//\\\\annabee
- Re: which way is faster?
- From: Frank Kotler
- which way is faster?
- Prev by Date: Re: how do you start learning assembly language
- Next by Date: Re: how do you start learning assembly language
- Previous by thread: Re: which way is faster?
- Next by thread: Re: which way is faster?
- Index(es):
Relevant Pages
|