How to tune Delphi XE’s start up

When I started Delphi XE today the first time, I recognized a 6 second delay when it shows “IDE Packages loaded” in the splash screen. On the second start it still shows “IDE Packages loaded” for 5 seconds. Because I wanted to know what the IDE does in those 5 seconds with 100% CPU load (25% on my 4 CPU machine), I debugged the IDE with an empty IDEFixPack for Delphi XE project (sorry no bug fixes yet  :mrgreen: ). I pressed the Pause-Button when it reached the delay.

The function that I saw in the call stack was the TStrings.IndexOfName method that was called by TStrings.SetValue. The string list contained about 3000 items. All of them were files in $(BDS)\source. That means that something enumerates all source file names and put them in the string list in the format “filename=path”. Returning from TStrings.SetValue showed me the IDE plugin that is responsible for the startup delay: Beyond Compare. The IDE plugin seems to cache file locations. I don’t know why it needs the location of all source files, but not on my computer. I have removed BC from the “Experts” registry key and now my IDE starts much faster.


BTW: Don’t forget to disable the Component-Toolbar package if you want to switch faster from Code to Design view.

This entry was posted in Delphi. Bookmark the permalink.

18 Responses to How to tune Delphi XE’s start up

  1. Pingback: Anonymous

  2. Moritz Beutel says:

    Great example of an initialization that could easily have been done in a background thread :)

  3. Anonymous says:

    “Easily” and “thread” in same sentence = Dangerous :)

  4. Andreas, thanks for the bug report. I do wonder which other blogs I should trawl to catch any more though. :P

    In my defense, the slowdown is only 2.7 seconds here, which isn’t noticeable if you have a full install and haven’t been optimizing IDE startup (takes ~18 seconds here).

    As for “Why?”: there’s a “Compare to Delphi Version” command that’s available if you’re editing a file that corresponds to one of the original Delphi ones (e.g., a modified version of Forms.pas).

    In any case, I’ll try to get this fixed soon, and post it on CodeCentral, and on our website.

  5. Jeremy North says:

    @Craig

    Yes, originally I cached this information so it was just a one time hit. This is why I didn’t bother to thread it.

  6. Jeremy North says:

    @Craig again…

    Perhaps you could put it back into a clientdataset as well since library size isn’t really an issue if it is going to be included with RS going forward. You could also just make sure it (the library) is built with runtime packages to reduce the actual file size.

  7. @Jeremy: It’s cached, but the cache is updated every startup, and we swapped out TDataSet for a TStringList to keep the DLL size down (assuming we’d include multiple versions in the BC installer), which is where most of the speed hit is. I haven’t talked to the developer responsible for those changes yet, but I don’t expect it to be a complicated fix now that we’re aware of the problem.

  8. Jan Derk says:

    Andy, weren’t you involved in the Delphi XE beta program?

  9. Jan Derk says:

    And it looks like Embarcadero isn’t using the new integrated AQTime profiler feature themselves yet.

  10. Jeremy North says:

    @Craig
    I meant cached between IDE sessions. ie: done once only

  11. Michael says:

    @Craig Peterson

    If you like to trawl some blogs, you can also look here: http://delphibugs.blogspot.com/

  12. Uwe Schuster says:

    @Jan: Beta testers are not allowed to speak about the Beta and their involvement.

    Read “What We Expect From Our Field Testers”
    http://dn.embarcadero.com/article/40234

    @Michael:
    o Craig is vendor of Beyond Compare and is not responsible for Delphi bugs
    o regarding “your” bugs: make sure they are in QC, make the users aware of the reports and get some votes on the reports

  13. ahmoy says:

    [Jan Derk: And it looks like Embarcadero isn’t using the new integrated AQTime profiler feature themselves yet]

    LOL!!!

  14. @ahmoy: This isn’t a Delphi XE performance problem. It’s the Beyond Compare IDE plugin that slows down the IDE’s start. The Delphi XE IDE itself seems to be very responsive (compared to all the deadlocks in Delphi 2009).

  15. Guti says:

    @Uwe: Delphi XE is not beta anymore, the trial can be downloaded from Embarcadero’s web site.

  16. Uwe Raabe says:

    @Guti: Even if the beta is over, beta testers are not allowed to talk about it, not even that they have been part of it. The only exceptions are beta bloggers who are allowed to talk about specific things.

  17. Michael says:

    Removing entries from “Experts”, “Known IDE Packages” or “Known Packages” does not work in XE.
    After you have start XE. The entries are back again.
    Cannot disable Beyond Compare or Component-Toolbar. (Yes… Delphi was closed)

  18. You can put an underscore as first cgar in the Value of the “$(BDS)\bin\comptoolbar150.bpl” entry. That will disable the package.