User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 375,216 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,319 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Views: 725 | Replies: 9
Reply
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Application slower when BDS not running

  #1  
Apr 24th, 2008
Hi all.

I'm writing a little program that paints and animates its own form in response to the user's mouse gestures. The weird thing is:

Whenever the BDS Delphi 2006 is running and I run my application, I get a framerate of about 25 FPS. If I terminate BDS but not my application the framerate stays high.

However, if I then restart my application when BDS is not running my application runs at about 11 FPS. This is without any change to the code or executable. (This also seems to me to be a little backwards... alas.)

I've recompiled my app using Delphi 5 and it still gets the slow framerate. My only conclusion is that BDS is doing something to the system or loading some Borland/Codegear shared module that is bumping performance?


In short, does anyone know why this is happening? And where I should look to make my application get the higher framerate?

Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Posts: 26
Reputation: jsosnowski is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
jsosnowski's Avatar
jsosnowski jsosnowski is offline Offline
Light Poster

Re: Application slower when BDS not running

  #2  
Apr 29th, 2008
Have you compared the running processin the Control panel both ways?
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Application slower when BDS not running

  #3  
Apr 30th, 2008
Hey, thanks for the reply.

No, I haven't used the control panel. I've directly timed it as: (number of paint events)/(milliseconds elapsed) while scrolling.

The point is that my executable is not modified in any way between testing with BDS running and testing without BDS running. Yet, my executable performs better when BDS is running.

Which means to me that BDS must be doing something either to the system or to the in-memory libraries common to both my application and BDS to make things faster. I can't figure out what that is though...
Reply With Quote  
Join Date: Nov 2007
Posts: 26
Reputation: jsosnowski is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
jsosnowski's Avatar
jsosnowski jsosnowski is offline Offline
Light Poster

Re: Application slower when BDS not running

  #4  
May 2nd, 2008
I was thinking that the processes window i the Control Panel would give you a view of what else is running when BDS is. A comparison of process with and without BDS might give you a hint. Also, does your program run slow if BDS was running and then shut down, as opposed to having never run between start-ups/log-ons?
Reply With Quote  
Join Date: Jun 2006
Location: Blumenau, Brazil
Posts: 67
Reputation: Micheus is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
Micheus's Avatar
Micheus Micheus is offline Offline
Junior Poster in Training

Re: Application slower when BDS not running

  #5  
May 2nd, 2008
Originally Posted by jsosnowski View Post
I was thinking that the processes window i the Control Panel would give you a view of what else is running when BDS is. A comparison of process with and without BDS might give you a hint.
I think that it's the best way to confirme if there is some diferente thing loaded by BSD.

I recommend Process Explorer v11.13, freeware from Microsoft.

Another point, like process priority - maybe BDS is (or put you program to) running with priority above normal.

Douas, you are using only a paint method? (nothing like DirectX, OpenGL... methods)

Bye
"It always has, at least, two ways to make one same thing. Exactly that they are certain and wrong"(Micheus)

Brazil - Blumenau
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Application slower when BDS not running

  #6  
May 3rd, 2008
Thanks for the info. That Process Explorer is slick.

Alas, I don't really know what I am looking for. As far as I can tell, my application and BDS don't share anything... (except some non-relocated kernel DLLS).

Other than that, all I know at this point is that my application runs more than twice as fast when BDS is in memory than when it is not.

The following behavior might be of interest:
1. Start BDS, then my app. Stop BDS. My app stays fast. Restart my app and it is slow again.

2. Start my app, then BDS. Stop BDS. My app becomes slow again.

3. BDS is always fast.

Arrgh!
Reply With Quote  
Join Date: Jun 2006
Location: Blumenau, Brazil
Posts: 67
Reputation: Micheus is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
Micheus's Avatar
Micheus Micheus is offline Offline
Junior Poster in Training

Re: Application slower when BDS not running

  #7  
May 4th, 2008
Originally Posted by Duoas View Post
The following behavior might be of interest:
1. Start BDS, then my app. Stop BDS. My app stays fast. Restart my app and it is slow again.
BDS load some thing; Your app uses it; BDS stop but this "thing" still is used by your app.
It sounds similar to a dll module load by an application...

2. Start my app, then BDS. Stop BDS. My app becomes slow again.
At this point, when BDS was started, your program was turned immediately fast?

I had think about GDI and GDI+, but I can't found some logica explanation to this case.
All graphical functions declared on Windows unit made reference to the GDI32.DLL. The GDI+ (GDIPlus.DLL) improve GDI... maybe the BDS was load GDI+... but this make no sense.

Sorry don't help you more. Maybe jsosnowski has some an other sugestion.

Good luck.
"It always has, at least, two ways to make one same thing. Exactly that they are certain and wrong"(Micheus)

Brazil - Blumenau
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Application slower when BDS not running

  #8  
May 4th, 2008
That's my thought exactly. I just can't figure out what BDS is doing... But I'll take a look at the GDI+.

I'm wondering if BDS is doing some sort of in-memory modification of one of the shared DLL's? (But that makes no sense either, because each process gets its own copy...) Is isn't overclocking my CPU or anything... aarrrrrghhhh.

I've also compiled with RtlVclOptimize.pas and I'm considering adding FastCode also...
Reply With Quote  
Join Date: Nov 2007
Posts: 26
Reputation: jsosnowski is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 3
jsosnowski's Avatar
jsosnowski jsosnowski is offline Offline
Light Poster

Re: Application slower when BDS not running

  #9  
May 14th, 2008
The only other though I have is ... We are assuming that something is turned on by BDS, what if something is being disabled that normally slows down the display rate?
Reply With Quote  
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,738
Reputation: Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all Duoas is a name known to all 
Rep Power: 10
Solved Threads: 173
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: Application slower when BDS not running

  #10  
May 14th, 2008
It is a possibility. It occurs to me that there might be something happening with the paging file or somesuch...

I wrote the program to operate off of a CD (via autoplay). I got the display rate sufficient to use, and the time came for me to give it to my friend (as a birthday gift), so I burnt it to CD and tested the CD, and the display rate went up to about 13 FPS.

Alas.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Pascal and Delphi Marketplace
Thread Tools Display Modes

Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 3:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC