Jump to content
FreeDelphiPascal

Delphi takes 9 seconds to start/shutdown an empty application

Recommended Posts

The mainboard of my old computer (Win 7 + Delphi 10.4) died after 12 years. God rest its soul in peace; it was a good computer :classic_sad:. I hope is goes into the hardware heaven :classic_biggrin::classic_tongue:.

 

So I moved to Delphi 11 on Windows 10 but everything seems slower.

Everything seems slower.

I don't know if it is the hardware or the OS or Delphi 11.

The laptop I got now is not as powerful as my 12 years old computer. The old computer was 32GB fast RAM, 8 core 4.2GHz CPU. This laptop is a Dell Latitude from 2020 with 16GB RAM and puny  i5-7440HQ (2.8Ghz) CPU. But is a newer SSD.

 

The problem is that if I run a pure empty Delphi program, Delphi 11 needs 4 full seconds to start it and 5 full seconds to shut it down. That 9 seconds for an empty app! Beyond laughable and beyond ridiculous.

I tried also an app of mine (50000 lines or so) and there is not much difference in time. Maybe the start is 0.5-1 second longer.

 

I will have to do some benchmarking this weekend but there are so many directions in which I have to look (OS, CPU/SSD, Delphi 11).

The antivirus (Defender) is stopped and the folder where I keep my projects are whitelisted anyway. The SSD encryption is off.

 

How is in your computers (for the same default/empty Delphi program)?

Could anyone do the experiment and then report the time, CPU, OS and Delphi ver?

 

_____________

Update: scrolling up/down into the IDE also is very slow and choppy.

Edited by FreeDelphiPascal

Share this post


Link to post

I am not familiar with Delphi 11 (yet), but at least with Delphi 10, most of the time of starting and ending a debugging session is spent with the IDE flickering and constantly redrawing itself over and over.

Share this post


Link to post
33 minutes ago, Der schöne Günther said:

I am not familiar with Delphi 11 (yet), but at least with Delphi 10, most of the time of starting and ending a debugging session is spent with the IDE flickering and constantly redrawing itself over and over.

YES. Now, since I moved to Win10, I have that too. So, are you on Win 7 or higher? If you are on a higher Windows, them it must be the OS that is doing that, since my old Delphi 10.4 was not doing that at all on Win7.

Win10 is so crappy that MS gave it for free for years and people were still not switching to it. They had to retire Win7 in order to force people switch to 10.

 

Edited by FreeDelphiPascal

Share this post


Link to post

I use Delphi 12.2 (but with old version were always the same) and the program starts immediately.

 

Also when invoke Debug there is no lag.

 

I have been using Windows 11 (with defender and firewall active) for many years, but I don't remember any problems like this in the past (in Windows 10 for example).

 

I have a laptop with I9-14900HX, 64GB, 2TB SSD, the previous one was similar but with I7-12700H and a rather old one was an I7-9750H.

 

Bye

Share this post


Link to post

I also have no problem using Delphi 11.2 on Windows 11 using a Laptop with  i7-1165G7 @ 2.80GHz 16GB and SSD. 

Share this post


Link to post

I honestly do not think that this is related to Windows itself.

You need to be more specific what exactly takes time, then we can try to find out what is causing this.

 

An empty VCL forms application takes about a second to start up in the debugger (Delphi 10)

A monolithic real world application with a bunch of dlls takes about six seconds for me.

I have learned to live with it ☕

 

Occasionally, I use Delphi 11 for a few other projects, and I remember it being slightly faster and flickering less.

Edited by Der schöne Günther

Share this post


Link to post
1 hour ago, FreeDelphiPascal said:

The old computer was 32GB fast RAM, 8 core 4.2GHz CPU. This laptop is a Dell Latitude from 2020 with 16GB RAM and puny  i5-7440HQ (2.8Ghz) CPU

The CPU alone would be enough to explain the difference. I'm guessing your old CPU was a AMD Ryzen 8700G which is 5-6 times faster than your new CPU.

https://www.cpubenchmark.net/compare/2962vs5836/Intel-i5-7440HQ-vs-AMD-Ryzen-7-8700G

In addition, the support circuits (all the stuff that's not the CPU), being laptop components, are most likely optimized for energy efficiency rather than performance.

My own laptop, a Lenovo X1 Extreme, was at the time I bought it the fastest (and most expensive 😞 ) laptop Lenovo produced but the performance is still... meh.. not impressive.

 

The RAM will also make a difference. Windows 10 will be able to handle 16Gb better than Windows 7 did but it's still on the lower side. I think the best thing you could do with this hardware is to add more memory. Depending on the current memory configuration you should be able to upgrade to 32Gb.

If I was you I would spend my effort on fixing your old system. Replace the parts that are dead. If you limit yourself to parts (CPU/MB/RAM/GPU) that are a few years old you can build a really good system on the cheap.

 

I reluctantly upgraded my main system from Windows 7 to 10 earlier this year. I had feared that it would kill the performance of my 10+ old system (Intel i5-2500K @ 3.30Ghz, 16Gb) but it actually performs pretty good. In many cases better than the old system did.

  • Like 2

Share this post


Link to post

 

 

52 minutes ago, Anders Melander said:

The CPU alone would be enough to explain the difference. I'm guessing your old CPU was a AMD Ryzen 8700G which is 5-6 times faster than your new CPU.

https://www.cpubenchmark.net/compare/2962vs5836/Intel-i5-7440HQ-vs-AMD-Ryzen-7-8700G

My 12 years old CPU was an AMD FX-8350 which has a raw performance superior to i5.

https://versus.com/en/amd-fx-8350-vs-intel-core-i5-7440hq

 

> The RAM will also make a difference.

I have a 45% of RAM free.

 

> If I was you I would spend my effort on fixing your old system.

I would like to repair my old rig but the mainboard (gigabyte ga-990fxa-ud3) died. TWICE!

The first mainboard will not POST.

Then I purchased a second hand mainboard (the same model) one year ago and it went belly up exactly the same way!!!

Looks like it reached a certain age and the bios parts started to degrade in the same way.

 

I did a Windows restart and now the shutdown of the program under the debugger/IDE is only 2 seconds.

Windows 11 was running for 178 hours!

I think I got to much used with Windows 7, which I would use for months without these issues 😞

So, it was a Windows problem.

The smaller CPU would explain the remaining 2 seconds needed for the IDE to shutdown the program and show itself.

 

Conclusion
Laptops are always a joke compared with desktops. That's settled 🙂 

So, now I am in the biggest dilemma: buy new laptop (portability) or build a brand new desktop PC (power)?

Edited by FreeDelphiPascal

Share this post


Link to post
52 minutes ago, Der schöne Günther said:

You need to be more specific what exactly takes time, then we can try to find out what is causing this. 

I mean the time from when I press the Close button in my program (empty application, no buttons, no nothing inside) until the IDE restores itself and I can type in.

Share this post


Link to post

Here with D12.2 that time is less than I need to move my hand from the mouse back to my keyboard.

 

Scenario: 

  • create empty VCL application
  • save project
  • run with debugger (i.e. Start with F9)
  • close running application with clicking on close button on form title
  • type something in the current editor view

Share this post


Link to post

Check if you have invalid path in Delphi options and in project options. Any invalid path, specially network path takes a lot of time.

Share this post


Link to post

My experience is that some invalid paths are valid. If you delete them, the IDE will crash easily.
This was a few years ago. I don't know if this is still valid.

Share this post


Link to post
50 minutes ago, FPiette said:

Check if you have invalid path in Delphi options and in project options. Any invalid path, specially network path takes a lot of time.

Yes, but this will have to do with the compilation time.
I am not taking into account the compilation time. I compile separately then I press F9.

_______


But I think the issue is somehow settled now. I think.

After restating Windows, I shaved 2 seconds from the start and stop time.

And I THINK the rest of the seconds are explained by the i5 CPU.

_______

 

REMEMBER: Windows 10/11 is not like Windows 7. Pressing shutdown does not do a true shutdown/restart.

So, I guess I will have to press Shift now each time I shutdown or always use the Restart function instead of Shutdown.
Looks like microsoft made the hardware Reset button useful again. Unfortunately, laptops do not have a reset button anymore.

Edited by FreeDelphiPascal

Share this post


Link to post
4 hours ago, Der schöne Günther said:

I am not familiar with Delphi 11 (yet), but at least with Delphi 10, most of the time of starting and ending a debugging session is spent with the IDE flickering and constantly redrawing itself over and over.

I found that annoying as well. For several years I would set the debug desktop to the regular desktop and turn off hide designers on run. Made compile/run/test cycles much faster. I usually did not need the debug panels as most testing was in the application being developed. No longer needed with very recent versions as IDE redrawing is better so switching desktops and hiding/unhiding designers is fast.

  • Like 1

Share this post


Link to post
55 minutes ago, FreeDelphiPascal said:

I would like to repair my old rig but the mainboard (gigabyte ga-990fxa-ud3) died. TWICE!

The first mainboard will not POST.

Then I purchased a second hand mainboard (the same model) one year ago and it went belly up exactly the same way!!!

Looks like it reached a certain age and the bios parts started to degrade in the same way.

So get a new MB that support the CPU you'd like. In my current system I have upgraded the MB in my system 3 times, the CPU 6 times, the GPU 2 times and the PSU 2 times. Always with newer and faster models. The only thing I haven't replaced is the 20 year old case (Lian Li PC-2100B tower) but that too will go the next time. I don't really need 12 internal and 6 external storage bays anymore 🙂 and being full aluminum it's quite noisy with all the fans.

image.thumb.png.2ddc460b5030f56186fdf31e5148d38e.png

 

1 hour ago, FreeDelphiPascal said:

So, it was a Windows problem.

Probably Windows Update. That's a repeat offender on my system.

  • Like 1

Share this post


Link to post
49 minutes ago, Anders Melander said:

So get a new MB that support the CPU you'd like.

There are no more NEW mainboards for that AMD FX-8350.

😪😪

Edited by FreeDelphiPascal

Share this post


Link to post

Been a while but I remember disabling some packages to speed IDE startup. Certainly, a welcome page listing the latest updates for an IDE that hasn't gotten updates in years is a waste of time to load with the IDE.

 

Often used the instructions at: Delphi packages I have disabled by prefixing their description with an underscore (and why) « The Wiert Corner – irregular stream of stuff

Share this post


Link to post
19 hours ago, Anders Melander said:

Probably Windows Update. That's a repeat offender on my system.

Yeah. Forced updates suck!

Microsoft suck worst than ever. No wonder their OS is going down: https://gs.statcounter.com/os-market-share


But this puts a higher burden on us. 15 years ago we only cared about the Windows. Nobody* owned a Mac.

But now, we must compile Windows, OSX and iOS and Android.

(Linux still doesn't count. Not even today.)

 

Microsoft didn't really had many good releases (in my personal opinion only XP and Win7 were good/stale). Microsoft just happened to be there at the appropriate moment.

 

---

* Most Macs were in US. In Europe was unheard of. And the total market was 5% anyway.

 

Edited by FreeDelphiPascal

Share this post


Link to post
7 minutes ago, FreeDelphiPascal said:

No wonder their OS is going down

If a market share value goes down, it does not imply that the absolute numbers are going down. If there were only 1 million Windows systems in the world, their market share would be 100%. Now when 4 million iPhones are sold, the Windows market share goes down to 20%, but there are still 1 million Windows systems.

  • Like 1

Share this post


Link to post

Maybe M$ retained in 2024 the same number of users as in 2014. But their SHARE of the market can still goes down. Maybe in 10 years they will even double the number of user and still drop their market share down to 1%.
So, why would you program for 1 million Windows users when the 80% of the market is taken other OS?

🙂
 

Edited by FreeDelphiPascal

Share this post


Link to post

PS: if still have horrible refresh issues when I scroll down the text in the IDE. If anyone has a fix for this, please let me know.

In Win XP I was fixing this by disabling "smooth scroll" in "performance". Now I disabled almost everything and still takes 3-4 seconds to scroll one screen of text:

 

Capture.thumb.PNG.1d9064b4af6cb75f9f53becddc4ed4b9.PNG

 

PS: it happens only on mouse scroll. Scrolling with arrows and pg up/dwn is fast.

 

I will try tomorrow this: https://www.thewindowsclub.com/change-mouse-scroll-speed-windows

Edited by FreeDelphiPascal

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×