
GameWindow loads slowly
Posted Friday, 13 May, 2011 - 14:37 by Henko| Project: | The Open Toolkit library |
| Version: | 1.0.0-rc1 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | confirmed |
Jump to:
Description
I have started experimenting with OpenTK on Windows. I have created a simple application with a GameWindow class that draws a triangle. I've noticed that it takes about 3-4 seconds for the game window to appear after starting the application. Why does it take so long? How can I make it faster? Thank you.


Comments
#1
This may be related:
http://www.opentk.com/node/2330
I am currently using a custom version of OpenTK SVN that only loads a subset of entry points. I have managed to cut down the dll size to around 900kB, and I think startup times are also faster.
#2
Hm, so you mean OpenTK loads too many extensions that I wouldnt even need? What are these?
#3
What video card and driver version are you using?
A saw a similar issue (3-4 seconds) after a recent Ati update but I haven't been able to pinpoint the cause.
#4
Mine:
OS: Windows 7 x64
Card: ATI HD 5770
Driver version: 8.821.0.0 (2011.01.26.) Catalyst Version 11.2
Now installed driver: 8.850.0.0 (2011.04.19.) Catalyst Version 11.5
Still having the same issue.
Friend of mine:
OS: Windows 7 x86
Card: ATI Radeon HD 2600 XT
Driver version: 8.821.0.0 (2011.01.26.) Catalyst Version 11.2
He is also having the same issue.
I also tried on linux with mono, it started there instantly! It seems to be a Windows problem.
#5
Here is the test application I used:
http://www.2shared.com/file/utcq3eHn/simple_OpenTK_test.html
It takes about 1 second for "Starting..." to appear in the console, then it takes 3 seconds for the gl window to appear.
I think this is quite annoying. Why is this faster on linux and mac?
#6
I used SlimTune to profile. You have to let the app run a few seconds, I did not get any data if I closed the app too soon though.
The contents of Test1.MyWindow.ctor() are the interesting part: most of that time is spent in GraphicsContext constructor (16%) and GraphicsContext.LoadAll (10%). Looking deeper, SetGraphicsModePFD() is taking time, and if you look even deeper than what is in the image, there seems to be some sort of recursive stuff going on.
#7
Its one of the most annoying thing when I'm thinking about choosing OpenTK.
My applications need several seconds to load, and I don't want to loose another 4 seconds just for OpenTK to load.
So no idea for this issue?
#8
I can reproduce but the cause is not yet obvious.
A delay of ~350ms is to be expected given the current architecture but these 4 seconds are a new issue that only happens on Ati.
#9
This also happens on nVidia; I have two computers that take 4 seconds before the window is opened and they both have nVidia cards; one has an old 8800 and the other one has a GT330
Is this linked to the number of extensions, or does it perform something else that takes time?
I can run some tests if there is something specific to troubleshoot.
#10
From what I see, the issue is in LoadEntryPoints;
on the nVidia GT330, I have 2279 delegates to parse.
The two questions I have:
- Can these delegates be split up quickly in categories to determine what we need and what we don't? (maybe before doing some more expensive operations)
- Has anyone tried to replace the 'foreach' by a Parallel.ForEach to see what happens?