Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Slow 2D

Author
Message
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 12th Dec 2006 21:37
How come the Box and Line commands are SO slow?



Running it as it is gives me 120-130 fps, in dbp i get 640fps.
Uncommenting the box command gives me 12 fps, same code in DBP gives med 120.

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
Argon Knight
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Gastonia, NC, USA
Posted: 13th Dec 2006 04:43
is it an illusion since your are not clearing the screen with the CLS command?
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 13th Dec 2006 09:20 Edited at: 13th Dec 2006 09:22
Its just a small snippet, and yes its somekind of effect.
Im looking for something looking cool as a background for a small 3D game im converting.
Its some code i converted from DBP, and in DBP it runs nice... but in DGDK.NET its unbearably slow. (talking seconds per frame rather than frames per second)

I'll see if i can find the link to the DBP code.

CLS makes it faster?

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 13th Dec 2006 09:48
Ok, i failed to find the link... but i have the original code.
It was from some kind of thread where there was a few graphical examples of some nice effects.



Proud member of The Unforgiven Warriors
http://www.tuwguild.com
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 13th Dec 2006 18:20
Can it be this:


Use the console for debugging maybe that will be faster.

--
Niels Henriksen
Working on a RPG right now
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 02:04 Edited at: 14th Dec 2006 02:07
No, i did that in the beginning.

That line actually runs twice as fast as


Proud member of The Unforgiven Warriors
http://www.tuwguild.com
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 14th Dec 2006 02:09
I can't confirm this ok, but because the .NET version of the toolkit uses the DGDK platform, this will not be completely inline with the DBP codebase, and therefore may result in slower performance on the 2D commands. Reasoning behind this is that iirc, TGC had made changes to the 2D stuff, including sprite handling that resulted in a performance gain in DBP when the 5.8 update was released.

I cannot confirm if this has been done with DGDK. At anyrate, when I have a bit of time, I'll try to stress test these functions to see if there is any problems. I will state though that you're probably gonna benefit from someone doing the exact same stress test in the DGDK (C++) version as well, just to be sure that this isn't a .NET issue.

Paul.

Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 14th Dec 2006 10:30
You won't like to know that DGDK (and therefore DGDG.NET) is slower than DBPro with some commands.

http://forum.thegamecreators.com/?m=forum_view&t=62533&b=22

Although, I haven't made any testing so far, I was supposing that DGDK was faster at 2D ...
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 14th Dec 2006 16:25
Quote: "Although, I haven't made any testing so far, I was supposing that DGDK was faster at 2D "


You have to appreciate that both DGDK and DGDK.NET will be at the moment. The DBP code base is more uptodate than DGDK and DGDK.NET although Mike and the team are working on this as we speak. Once the C++ version is inline with DBP, both toolkits will perform as fast, or even faster than DBP.

Paul.

James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 17:49
Actaully, i think its C# that is slow.

An empty loop (like the one in my first post) runs much slower than a loop in DBP. 5-6 times speed difference actually for the same amount of loops.

I thought about testing with other loops than for (while/foreach) to see if it was only the for loop suffering... stay tuned ^^

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 17:59
This is about 5-10% slower than for loop


And this is variating alot. Sometimes faster than for loop, other times slower than while, but generall +/- 5%.


Proud member of The Unforgiven Warriors
http://www.tuwguild.com
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 14th Dec 2006 18:19
What Sync rate have you setup? I'm not entirely convinced that the timing on both of those code snippets is accurate. Would you be willing to post the entire source because doing the Sync call will invariably change the timing depending on the refresh rate as well.

The ideal test would be to use proper start/end benchmarking on the actual code executed before Sync is called.

Paul.

James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 18:25
Heres an extreme example.

C#


DBPro


This is a Plasma code snippet made by Ric (in the 20Liner forum i think)


DBPro gives me ~100 frames per second
DGDK.NET gives me ~65 seconds per frame

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 18:27
My monitor is running 75 Hz refreshrate and i disabled vertical sync to up the fps.
The code has SyncRate(0). There is no more code.

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 14th Dec 2006 19:59
Ok, I'm investigating this because even if I completely remove the code for the itterations, i.e, just rotate's the matrix, the frame rate is way slower than DBP's. The thing is, I'm still not convinced about the C# itteration speed because until DGDK is inline with the DBP 6.3 codebase, I know that the system will perform slower anyway. I'll let you know how it goes.

Paul.

James Bondo
18
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Dec 2006 23:12
maybe we should try to compare with whatever version of DBP it is on par with.

Proud member of The Unforgiven Warriors
http://www.tuwguild.com
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 15th Dec 2006 00:21 Edited at: 15th Dec 2006 00:21
This is most odd, I converted the sample to run under the DGDK (C++) version as well, and DBP outperforms that! O.O

I'm convinced that this is a codebase issue.

Paul.

Miguel Melo
19
Years of Service
User Offline
Joined: 8th Aug 2005
Location:
Posted: 15th Dec 2006 19:26
This sort of slowdown has been reported in the past and people never quite understood why the C++ version is slower than the DBP version on some functions/functionality.

I can only conclude that the GDK core codebase isn't quite the same as DBP as we expect/are led to believe... which would justify why certain things that have always worked on DBP (like ghosting) are broken in the 1.6.2c update.

I have vague plans for World Domination

Login to post a reply

Server time is: 2024-11-19 10:27:48
Your offset time is: 2024-11-19 10:27:48