Application runs 10 times faster when Delphi IDE is open

My D2007 application runs 10 times faster when I run the Delphi IDE at
the same time.

In detail:
* I start my application, it runs slow
* With my application still running, I start Delphi. My application
miraculously switches to some turbo-mode, and runs 10 times faster
* with my application still running, I shutdown Delphi. My application
switches back to its original slow state.

Extra weird:
When I run Xananews i.s.o. the Delphi IDE, I get the same results.

Profiling with AQTime shows the delay is in a line with
"ClientDataSet.Open".

I made a small test-client which shows the same delay in this method:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Count1 := 1;
  Stop := False;
  while (Count1 < 1000) and (not Stop) do
    begin
      ClientDataSet1.Close;
      ClientDataSet1.Open;
      Count1 := Count1 + 1;
      Edit1.Text := IntToStr(Count1);
      Application.ProcessMessages;
    end;
end;

Some background information:
* I am using Delphi RAD Studio 2007 on Windows XP
* The Clientdataset connects with a SocketConnection to a
DatasetProvider on a serverapp (on a different machine). This
DatasetProvider is connected to a TSQLQuery, connected to a SQL-Server
database.
* This TSQLQuery executes this simple command:
"SELECT * FROM Mutaties WHERE MutatieID = :MutatieID"
In the above test, the parameter is 0, so no records are returned.

What on earth can be happening?

Thanks for any suggestions,
Tiedo
0
Tiedo
5/28/2010 6:48:19 AM
embarcadero.delphi.multi-tier 396 articles. 0 followers. Follow

8 Replies
1298 Views

Similar Articles

[PageSpeed] 34
Get it on Google Play
Get it on Apple App Store

Tiedo Kruisselbrink wrote:

> My D2007 application runs 10 times faster when I run the Delphi IDE at
> the same time.
> 
> In detail:
> * I start my application, it runs slow
> * With my application still running, I start Delphi. My application
> miraculously switches to some turbo-mode, and runs 10 times faster
> * with my application still running, I shutdown Delphi. My application
> switches back to its original slow state.
> 
> Extra weird:
> When I run Xananews i.s.o. the Delphi IDE, I get the same results.
> 
> Profiling with AQTime shows the delay is in a line with
> "ClientDataSet.Open".
> 
> I made a small test-client which shows the same delay in this method:
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>   Count1 := 1;
>   Stop := False;
>   while (Count1 < 1000) and (not Stop) do
>     begin
>       ClientDataSet1.Close;
>       ClientDataSet1.Open;
>       Count1 := Count1 + 1;
>       Edit1.Text := IntToStr(Count1);
>       Application.ProcessMessages;
>     end;
> end;
> 
> Some background information:
> * I am using Delphi RAD Studio 2007 on Windows XP
> * The Clientdataset connects with a SocketConnection to a
> DatasetProvider on a serverapp (on a different machine). This
> DatasetProvider is connected to a TSQLQuery, connected to a SQL-Server
> database.
> * This TSQLQuery executes this simple command:
> "SELECT * FROM Mutaties WHERE MutatieID = :MutatieID"
> In the above test, the parameter is 0, so no records are returned.
> 
> What on earth can be happening?
> 
> Thanks for any suggestions,
> Tiedo

I found out also:
* When using Database Workbench i.s.o. Delphi IDE or Xananews, I get
the same results
* When I replace the TSockectConnection with a TDCOMConnection
everything goes alwasy fast.

Tiedo
0
Tiedo
5/28/2010 7:03:54 AM
Tiedo Kruisselbrink wrote:

> * When I replace the TSockectConnection with a TDCOMConnection
> everything goes alwasy fast.

	Well, there you go. Put WireShark on it and find out why the network
connect is slow when you don't have an existing connection. DNS?

-- 
Craig Stuntz · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/
0
Craig
5/28/2010 1:38:58 PM
Craig Stuntz wrote:

> Tiedo Kruisselbrink wrote:
> 
> > * When I replace the TSockectConnection with a TDCOMConnection
> > everything goes alwasy fast.
> 
> 	Well, there you go. Put WireShark on it and find out why the network
> connect is slow when you don't have an existing connection. DNS?

Thank you for your reply, but you are running to fast for me:

* Do you suggest that I "don't have an existing connection" when using
TSocketConnection? What is the influence of running the IDE on that?
* What is "DNS"?

Thanks,
Tiedo
0
Tiedo
6/1/2010 5:51:03 AM
Tiedo Kruisselbrink wrote:

> * Do you suggest that I "don't have an existing connection" when using
> TSocketConnection? What is the influence of running the IDE on that?

	The IDE keeps a connection open at design time.

> * What is "DNS"?

	Domain Name System.	

-- 
Craig Stuntz · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/
0
Craig
6/1/2010 12:55:35 PM
To clarify: If you have a slow DNS, the first connection to a server
will be slow, as the domain name is resolved. Subsequent connections
use the cached IP address, and are faster. A way to test for this is to
connect via the numeric IP address, rather than the "human-readable"
name.

	Other networking issues can cause similar effects.

	Essentially, I think you have a networking problem, not a Delphi
problem.

-- 
Craig Stuntz · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/
0
Craig
6/1/2010 12:57:43 PM
Craig Stuntz wrote:

> 
> 	Essentially, I think you have a networking problem, not a Delphi
> problem.

I don't think I have a networking problem: when working with all
components (clientapp, serverapp, dbms) on my local machine, it all
behaves te same:
- with IDE running, serverapp with TSocketServer is fast
- with IDE not running, serverapp with TSocketServer is slow
- when I have delphi-apps like XanaNews or DatabaseWorkbench running,
serverapp with TSocketServer is also fast
- serverapp with TDCOMConnection is allways fast

I agree it looks like a connection is opened and closed all the time,
while the IDE (or xananews or databaseworkbench) is keeping it open.
If this is really the case: what can I do to keep the connection open
in my serverapp?

Thans
Tiedo
0
Tiedo
6/3/2010 7:10:45 AM
Tiedo Kruisselbrink wrote:

> I don't think I have a networking problem:

	Then I don't think I can help you.

-- 
Craig Stuntz · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz/
0
Craig
6/3/2010 12:46:59 PM
Tiedo Kruisselbrink wrote:

> My D2007 application runs 10 times faster when I run the Delphi IDE at
> the same time.
> 
> In detail:
> * I start my application, it runs slow
> * With my application still running, I start Delphi. My application
> miraculously switches to some turbo-mode, and runs 10 times faster
> * with my application still running, I shutdown Delphi. My application
> switches back to its original slow state.
> 
> Extra weird:
> When I run Xananews i.s.o. the Delphi IDE, I get the same results.
> 
> Profiling with AQTime shows the delay is in a line with
> "ClientDataSet.Open".
> 
> I made a small test-client which shows the same delay in this method:
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>   Count1 := 1;
>   Stop := False;
>   while (Count1 < 1000) and (not Stop) do
>     begin
>       ClientDataSet1.Close;
>       ClientDataSet1.Open;
>       Count1 := Count1 + 1;
>       Edit1.Text := IntToStr(Count1);
>       Application.ProcessMessages;
>     end;
> end;
> 
> Some background information:
> * I am using Delphi RAD Studio 2007 on Windows XP
> * The Clientdataset connects with a SocketConnection to a
> DatasetProvider on a serverapp (on a different machine). This
> DatasetProvider is connected to a TSQLQuery, connected to a SQL-Server
> database.
> * This TSQLQuery executes this simple command:
> "SELECT * FROM Mutaties WHERE MutatieID = :MutatieID"
> In the above test, the parameter is 0, so no records are returned.
> 
> What on earth can be happening?
> 
> Thanks for any suggestions,
> Tiedo

I Found a workaround for my problem: I set
SocketConnection.SupportCallBacks to False (default is True)

Now the socketconnection allways works fast.
I don't understand why.
I wonder what the disadvantages of this solution can be.

Thanks,
Tiedo
0
Tiedo
6/14/2010 8:14:56 AM
Reply:

Similar Artilces:

Application running 10 times faster when IDE is open
My D2007 application runs 10 times faster when I run the Delphi IDE at the same time. In detail: * I start my application, it runs slow * With my application still running, I start Delphi. My application miraculously switches to some turbo-mode, and runs 10 times faster * with my application still running, I shutdown Delphi. My application switches back to its original slow state. Profiling with AQTime points out that the delay is on a line with "TClientDataset.Open" What on earth can be happening here? Some background information: * Delphi RAD Studio 2007 on Wind...

Forgot how to run Delphi 10 IDE Debugger
I'm getting back to running Delphi 10 and seem to have forgotten how to run the IDE debugger. My program builds properly. When I try to "run" the program under the debugger, I can set a breakpoint. When the program stops at that breakpoint, however, the "step over", "trace into", etc. commands are grayed out and are not operative. I suspect that this has something to do with Delphi Compiler Project Options I have set up, but I'm not sure if this is the problem. Run | Run, or Press F9 to debug the active project. There is no product called Delphi...

Unofficial Delphi 7 updates
Anybody noticed, even tried this Enhanced Run Time library for Delphi ? It's a hack of the D7 RTL/VCL http://blog.synopse.info/post/2009/12/20/Enhanced-Run-Time-library-for-Delphi-7 It's very interesting and I'd like to know it's stability. Edwin Ye wrote: > Anybody noticed, even tried this Enhanced Run Time library for Delphi > ? It's a hack of the D7 RTL/VCL This library violates Delphi's license (redistributing of RTL/VCL source files is not allowed). The last post was deleted and I'm sure this one will be deleted, too. -- Andreas H...

Run an external application as hide application and control it with Delphi
I need run a 3rd application (I think developed with Visual Studio) and hide it (the user don't must see it), then I need: 1. click on a menu to open a window, click on tab component; 2. set 2 edit fields, and choose a item from combobox; 3. click on a button and extract 2 text from 2 edit fields; 4. close the application; All this without user see nothing. Is it possible in anyway? I need do it with a Delphi (XE3) application. I don't have experience about control of 3rd application an I don't know if it possible. Is there a free library to use UIAutomation? Martin Masc...

PB8
Hello, Sorry my english isn't very good, but I hope you can understand my question and somebody is able to help me. I know work with PB8 (befor PB6). In PB6 I could run or debug the application witout opening the application object. But now in PB8 every time I try to start the application (without opening the application object) there comes a system error and PB8 and the application crash. Is it not possible to run an application in PB8 when the application object ist closed? Or does somebody has a solution for this case. I would be happy if somebody could help me, beca...

Converting Delphi 2007 Indy 10.2.3 to Delphi 2009 Indy 10.5.5 [Edit]
Hello, I am currently attempting to port over a Delphi 2007 project that uses Indy 10.2.3 (very successfully) to Delphi 2009 and Indy 10.5.5 (I just got the latest development build this morning). I think I am running into an encoding issue, but am not sure. Specifically, IDHTTP with SSL calls an old CGI and the CGI returns a .zip file and I then save it to the disk. In 2007 and before this worked perfectly. In 2009, it is not. Here is the examples of the 2 different results (though cut way short in the post) I am getting back: 2007: 'PK'#3#4#$14#0#0#0#8#0'rLQ9žrPb€'#0...

Opening up a PAS file opens up another instance of Delphi XE IDE... [Edit]
Here's the problem: When I double click on a .Pas file. a new Delphi XE IDE opens up. Is there a way to open up the file inside of the Delphi XE IDE that is currently open? Edited by: Joseph Trapani on Jan 31, 2012 4:04 PM > Here's the problem: > When I double click on a .Pas file. a new Delphi XE IDE opens up. > Is there a way to open up the file inside of the Delphi XE IDE that is > currently open? > > Edited by: Joseph Trapani on Jan 31, 2012 4:04 PM Drag and drop the file onto the IDE? BTW: I have my .PAS files set to open in a text editor ...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

Delphi 2006 vs Delphi 2009 IDE stability
Hello, all. I have medium sized project which includes about 20Mb of source code (just size of *.pas files). I use Delphi 2006. There are third party component suites JVCL, DevExpress Bars, Pegasus Imaging. All updates applied. The main problem is IDE stability. About four..five times a day IDE become unstable after intensive usage of code insight functions (most often I press Ctrl+Space key). The best outcome is that I have to save everything and restart the IDE. The worst outcome is when IDE stalls or falls into endless loop of error messages and any unsaved work is lost. OS...

Running Delphi Application over the web
Hi All, We have a large Delphi desktop application which we would like to port to the Web. If we shut the UI down on the app, could a web service run the application in the background as is and have it respond to queries via a command line interface? If that is not possible, what is the best way to share non UI code, between a web application and a Delphi Application? I know this is a big topic just looking for someone to point me I the right direction. Thanks Bob McKinnon wrote: > Hi All, > > We have a large Delphi desktop application which we would like to p...

Delphi 2010 and Delphi XE5 shuts down when opening projects
Over the last week I have found it increasingly difficult to open projects. Even really simple projects, some more complex. For example if start Delphi 2010 Enterprise Edition. I see the list of recently opened projects. I then click on a simple existing project, I get a hour glass for about a second and then Delphi IDE has gone. In the windows task manager, there are now no applications running. I have not changed the installation, being using Delphi 2010 enterprise on the same computer for a few years. I'm not a full time developer, but do internal development of our compa...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Stack overflow when opening a Delphi 7 frame in Delphi XE4
I am trying to port a Delphi 7 application to Delphi XE4. I have installed all the required component libraries in Delphi XE4 and I managed to open the Delphi 7 project in Delphi XE4. However, when I try to open one of the units containing a VCL frame I get the error "stack overflow - Save your work and restart RAD studio XE4". If I don't open any frames and try to build the project, the compiler can't find the components in the above mentioned frame unit and stops with an error. What should I do? Pier I figured out what the problem was. I has a TsiLang compo...

ActiveX differences between Delphi 7 and Delphi XE4 in an MFC application
When I create an ActiveX control based on a TPanel (with no added code) in Delphi 7, I am able to add this to a MFC C++ application and have it run fine. When I take the exact same code and compile it in Delphi XE4 (and XE2), MFC throws an assertion. I confirmed that the only changes are in the dcu, ocx and res files. The assertion is happening on ASSERT(wFlags == DISPATCH_METHOD); in occsite.cpp (I included the source to this). {code} STDMETHODIMP COleControlSite::XEventSink::Invoke( DISPID dispid, REFIID, LCID, unsigned short wFlags, DISPPARAMS* pDispParams, VARIANT* pvar...

Web resources about - Application runs 10 times faster when Delphi IDE is open - embarcadero.delphi.multi-tier

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

The Bachelor 2016 application process can get explicit - Laurina Fleure
CHANNEL Ten is calling on singles to sign up for a chance to find love on The Bachelor , but willing applicants have to open a lot more than ...

Would you give up chocolate for better application performance?
Application performance is critical to business performance according to 98 percent of businesses, yet 89 percent of executives say the poor ...

Gun Sales, Concealed Permit Applications Surge After San Bernardino
The day after Syed Farook and Tashfeen Malik opened fire in San Bernardino, gun sales and concealed carry permit applications surged.

MBA: Mortgage Applications Increase in Latest MBA Weekly Survey, Purchase Applications up 29% YoY
From the MBA: Mortgage Applications Increase in Latest MBA Weekly Survey Mortgage applications increased 1.2 percent from one week earlier, ...

Falling Costs, Rising Applications Will Boost US Energy Storage Market
... in 2013 to 3,659MWh by 2020 on improving economics and policy developments, predicted GTM Research's Shayle Kann Falling Costs, Rising Applications ...

Mortgage applications down 0.2%
Mortgage interest rates haven't moved much in the past three weeks, but they are holding at a higher level than for all of 2015.

California Film & TV Tax Credits Applications Dip In New Small Screen Round
With production on the uptick in the home of Hollywood , the second round of those seeking small screen Golden State tax credits saw 32 applications ...

Digitimes Research: China touch panel makers increasing investments in niche products and large-size ...
The China International Touchscreen Exhibition (C-Touch) was recently held in Shenzhen, China, featuring a number of local and international ...

Six internet-of-things applications in big new government trial
Manchester, England, is set to be the UK demonstrator city for internet-of-things innovation. Of course, there is much smart technology already ...

Resources last updated: 12/10/2015 12:30:43 AM