Archived

This topic is now archived and is closed to further replies.

Why is Directx8 Initialization so slow?

This topic is 5747 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I have made a little program which creates a Directx window + the direct3d device and a directinput device, but the initialization is very slow! That takes approximately 1.121 seconds which is a bit much I think, because I use the retail version of dx. Is dx so slow? Or what else could happen? Thanks in advance -- tSG --

Share this post


Link to post
Share on other sites
interesting. I''ve never bothered to time it. What exactly were you timing (what is the start and what is the end)? How long does the same app take to start up if you remove the DX calls? How long were you expecting it to take?

I don''t know if anyone here will argue with this or not, but I''d say don''t worry about it unless you find that a "real" app is unacceptably slow.

If you let us know what you''re timing exactly, we can tell you if anything is unusual.

Share this post


Link to post
Share on other sites
Cmmon man.What you should tell us is how u measure this.First of all, what pc are u using? Do u measure this using an .exe or when u compile your program? Anyway, what you should really care about is the real-time performance and not the initialization time ...

~The fastest polygons are those you don''''t draw...~

Share this post


Link to post
Share on other sites
I have a cel800 and an abit siluro gf2mx.

Actually, this is the slow part in the initialization:
dx8.pD3D = Direct3DCreate8( D3D_SDK_VERSION ) );
That takes 1.1 sec for me to execute.

You could say that 1.1 sec is not long, but in the development time it is really annoying! I have to compile and execute the program really often, so that takes my important development-time!
I would expect ca. 0.1-0.2 sec for this call, as under opengl. (They are rather similar nowadays)

PiXeLatiOn: I use timeGetTime(), it is rather punctual in the most cases. Oh, and the issue occurs when I run the .exe.


-- tSG --

Share this post


Link to post
Share on other sites
1. I don''t get a pause on any of my machines (home + 2 at work) with either the retail or debug versions of D3D!

2. However I have seen a pause on a colleagues machine.

3. Do you have a virus scanner running ? - that was the cause of the majority of the time on the colleagues machine - the virus scanner was searching all of the DLLs which D3D loads for signatures.

4. Do you use WHQL certified drivers ? - try using non-certified - a lot of extra things get tested in certified drivers!.

5. There are a hell of a lot of things going on during that innocent looking call - try running FileMon and RegMon from www.sysinternals.com - you''ll see a lot of activity!

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Your chip isn''t exactly the fastest chip and also: do you have lots of icons in your system tray (give us a count)? How much RAM do you have (in MB)? What else is running at the time?

Share this post


Link to post
Share on other sites
tSG is right. Direct3D initialization is slow. Personally I wouldn't bother complaining about it, as I don't consider it a big deal, but my engine supports on-the-fly switching between Direct3D and OpenGL, and activating OpenGL is nearly instantaneous, whereas Direct3D takes about a second to load.

~CGameProgrammer( );



EDIT: And I have 512mb RAM and a 32mb GeForce2 with the latest drivers. I disabled Norton AntiVirus' Auto-Protect to see if it made a difference, but it doesn't make a noticeable one.

[edited by - CGameProgrammer on April 21, 2002 3:23:49 PM]

Share this post


Link to post
Share on other sites
First of all, thanks for the replies!

S1CA:
3. I have a virus scanner running. It seemed as a good explanation for the slowdown, but the init is just as slow if I shut down the virus scanner.

4. I use the 28.32 detonator. I don't know surely whether it is WHQL, but I guess it isn't.

5. Yeah, maybe that is the problem. But why does it need so lots of activities?


Puzzler183: I have 9 icons in the tray + running wincmd and one IE. I have only 256mb RAM, I know it is rather a small amount but CGameProgrammer has 512mb and he/she also has the same performance issue.

CGameProgrammer: It seems that only on some machines. For example on S1CA-s computers it isn't slow.

Btw. what OS are you using? I am using win2000 prof., maybe that is the problem(?)
Long before when I had tnt2 I didn't encounter that slowdown, so another question: what kind of videocards are you using?


-- tSG --

[edited by - tSG on April 21, 2002 4:05:38 PM]

Share this post


Link to post
Share on other sites
That''s a good idea, asking the operating system. I''m using Windows XP Home Edition. Maybe on systems with the 9x kernel, there is no slowdown.

~CGameProgrammer( );

Share this post


Link to post
Share on other sites
I am on 1ghz tbird 266ddr, gf2 pro, 7200rpm hd ibm gpx60, win98 and d3d initialization is slow upon app. startup. Probably all the COM that needs to init. takes time. I don''t know. But I did noticed how slow it is, doesn''t bother me that much and I hope ms fixes it in dx9 if it can be fixable, if not then I''ll live with it.

Share this post


Link to post
Share on other sites
JD: yes, it is sure that COM initialization takes the time, but why doesn''t it take for every people? I don''t know the answer, but it worked me faster when I used tnt2, detonator 6.50(?) and the same OS just server(!) edition. A server edition is sth, which should be slower as a prof. version... it seems this is a Microsoft secret
Thanks for the replies!


-- tSG --

Share this post


Link to post
Share on other sites
The answer to your question is
ALL nVidia cards are slow on intitialization.
I don''t know if it''s a chipbased or driverbased problem,
but that''s the way it is. Nag nVidia about it, and tell
me if you get a decent reply =)



--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Share this post


Link to post
Share on other sites
tok_junior: and other cards - like ATI - aren''t so slow? Well, I will complain at nVidia But make me sure that ATI-s don''t have that issue as I don''t want to make me stupid.


-- tSG --

Share this post


Link to post
Share on other sites
I''m feeling smug now because my box starts DX without any delay . I''m running winXP on an athlon 800, 128Mb, voodoo 3 3000 AGP.

Share this post


Link to post
Share on other sites
what confuses me is that on both my home machine and my work machine, both of which have GeForce 2 cards, I see no such slowdowns!!! (one has an AMD Athlon CPU with Windows98 and the other is a Intel P4 CPU with Windows2000)

The other confusing thing is that the colleagues machine I described has an ATI card.


...which does mean I''m inclined to think this is a result of some other part of the machine.


Try running DXDIAG - see how long the tests take to start up. DXDIAG will also check for any dead driver entries in the registry - if you''ve ever swapped cards you might find that parts of the old cards drivers still remain!...

it happened to me on an older machine - it had a 3Dfx Voodoo2 in, I uninstalled the drivers then installed a Matrox G400. When I started any D3D apps in a debugger, strangely enough when enumerating the D3D devices in the system a 3DFX .DLL was being loaded!.


Also try running in a debugger - see which DLLs get loaded. Some joypad and mouse drivers also do naughty "hook" things when every app starts up.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
If the problem is with the card, then why isn''t OpenGL initialization slow? Or do you mean the problem is specifically with nVidia''s Direct3D drivers?

~CGameProgrammer( );

Share this post


Link to post
Share on other sites

Reason why its slow (iam acting cool now so dont tell me iam wrong, iam doing the finnish iam the king style) :

1) Your harddrive has bad seeking speed (remember all dlls and crap are loaded from file and such)
2) OpenGL32.DLL is like mega big , D3D has its dll spreaded allover the system folder
2) D3D fiddles with some options from DXDIAG (Opengl doesnt have this, opengl is 100% driver depependant, d3d has the same options in drivers to usually (gamma etc))
3) D3D Checks what your device can/cannot do in some phases wich opengl doesnt care about since the driver is 100% on its own


Oh and btw, I never noticed any speed trouble with initing the d3d stuff myself or well 1 sec is nothing since throwing up the window,loading stuff from hd etc .. Generating some vertexbufferts etc etc.. that sure takes some time so loading something in 1 sec .. never seen it on pc at all =)

Share this post


Link to post
Share on other sites
I''ve run the exact same app on two machines in school. Both were installed using the exact same hd-image with win2k. One is running an ATI Rage 128, and one is running a GeForce2MX.
On the ATI-box, it starts in no time at all, and on the GF2-box, it takes a few sec''s. This only occurs when im running D3D though... But I''m inclined to believe the difference depends on the nVidia chipset/driver...


--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I am very cool and would like to fuck only men and butch women.

"Would you like to see the my nuts to your fist style?"

"I''m a rapist, what are you?"
Kung Pow Enter the Fist is the best movie ever.

I like females with one breast and males with one nut.

Share this post


Link to post
Share on other sites
On a side note, is ~32 DLLs being loaded normal =)?

And can I kill some of them? =)

Z.

Share this post


Link to post
Share on other sites
Alot of the standard libraries are unnecessary. Try disabling all default libraries and then add the ones you need (when the linker makes errors, just guess which libs you need based on the functions it's complaining aren't defined).

~CGameProgrammer( );

EDIT: Among the standard headers, my program only needs user32.lib and gdi32.lib. Probably that's all yours needs, but who knows. If you use MFC you might need a couple more, besides the MFC libs.

[edited by - CGameProgrammer on April 24, 2002 2:55:41 AM]

Share this post


Link to post
Share on other sites