6
votes

I am working with Delphi 2009 Pro and just tried to find out why code completion is so slow in my setup. Whenever code completion is invoked, the IDE locks up for up to 30s, which really interrupts any workflow.
When working with BDS 2006, code completion was incredibly fast compared to Delphi 2009.
After reading this post it seems to be normal for Delphi 2009, but just turning off the automatic code completion is not anything I want to do.

My question is:
If I switch to Delphi 2010, will I have the same slow speed for code completion or was it improved to a point to be usable?

EDIT:
I found the main problem why my IDE was so unresponsive. I used a file MSHTML_TLB.pas, created through the function "Import a typelibrary", which is 16MB of code. This file being scanned for code completion froze the IDE for up to 30s. Without that file being in the project, I'd say code completion is as fast as it was in previous versions.

4
30 s? Is that normal? On my computer I have never observed any delay at all, even in very big and complicated projects.Andreas Rejbrand
It worked fine for me with BDS2006 and I always read that this was a very slow IDE. Delphi 2009 ist faster, sure, just not in regards to code completion.Holgerwa
D2010 is faster for me. However, I mostly use C++ - I'm not certain it's faster on the Delphi side.David
I have the same problem on large projects, whether the project is in D2007 or migrated to D2010. A large enough project will cause code completion to kill the editor for anything up to maybe 30-40seconds - enough to distract you and get in the way. I'd love to see a fix, or at least a usable workaround for this. Often I end up turning it off which is a huge shame because it's genuinely useful.robsoft
How many thousands of lines are your top five largest .pas files?Warren P

4 Answers

6
votes

Try CnWizards http://www.cnpack.org/showlist.php?id=39&lang=en

CnWizzards is an free open-source plugin for Delphi IDE, it adds several improvements to the IDE, like, messagebox wizard, code statistics, code structure highlight, improved code completion, and many more...

5
votes

Unfortunately, no. It hasn't gotten any faster in Delphi 2010.

2
votes

I'm not sure it is actually slower in D2010 than in D2006.

Have you tried to

  • clean up your uses clause,
  • make sure your paths (lib, search) are short and without obsolete directories/network links,
  • explicitly include all used units in the dpr
  • reorder your uses clause?

The idea is to make the "on-the-fly" compiler arrive at your position in code as quickly as possible.

2
votes

I used to have this problem both on my laptop, and when I was using network drives - I would get a hang for up to 30s the first time code completion was triggered.

To counter this, I moved the files I was working on to a local fast drive and the problem almost went away - I still had a hangup, but only for a second or 2 instead of 30!