6

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.

Community
  • 1
  • 1
Holgerwa
  • 3,430
  • 9
  • 42
  • 50
  • 1
    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 May 23 '10 at 18:54
  • 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 May 23 '10 at 19:38
  • D2010 is faster for me. However, I mostly use C++ - I'm not certain it's faster on the Delphi side. – David May 23 '10 at 23:43
  • 1
    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 May 24 '10 at 07:36
  • How many thousands of lines are your top five largest .pas files? – Warren P May 25 '10 at 16:20
  • Warren: the biggest one has 9000 lines, then some with about 5000 lines. – Holgerwa May 25 '10 at 20:22

4 Answers4

6

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...

arthurprs
  • 4,457
  • 3
  • 26
  • 28
  • -1 for a useless link to a page of non-descriptive download links. Could be anything. Could be useful, could be NSFW, could be malware, there's no telling. – Chris Thornton May 24 '10 at 13:49
  • 1
    I know that cnWizards is not malware. It is a useful addon for Delphi. – Roland Bengtsson May 24 '10 at 14:43
  • I gave this -1 because I generally do not like 3rd-party solutions, *especially* if the answer in no way answers the given question: Is D2010 faster than D2009? – Andreas Rejbrand May 24 '10 at 16:49
  • 3
    +1 Although the answer is not directly related to the question: "Is Code Completion speed improved in Delphi 2010?", it is clear that the user is looking for a faster code completion solution, and CnWizards provides this. Code Completion provided by CnWizard is much faster than Delphi's default implementation, and its auto invoke features works much better. Also it works on a broader range of identifiers, and can search for the entered word even if it is in the middle of identifier name, not just beginning. Delphi's own code completion is a piece of crap in compare to CnWizard's. – vcldeveloper May 25 '10 at 08:14
  • 1
    I tried cnWizard for a few days and it works MUCH better than the Code Completion of Delphi. Thanks a lot for the link. Of course, it would be much better if the built in feature would be improved, since we have to deal with it every minute of our (programmers-) life. – Holgerwa Jun 02 '10 at 07:58
5

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

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
  • That is a pity, I use D2007 and I regularly have long freezes around 30 seconds for code completion. Also things like when write method-name and type '(' it may freeze for a long time. The project has around 1,5 millions source lines and hundreds of source files. I use D2007 and I have sometimes thought of create a new project and add a source file one by one to maybe clean it up and make it faster. But it may never happens due to lack of time and it may even not improve performance... – Roland Bengtsson May 24 '10 at 14:53
  • 2
    Yeah, the open parenthesis thing is particularly annoying. You can disable that under Tools->Options->Editor Options->Code Insight. Then it will only give you parameter help if you invoke it with CTRL-SHIFT-SPACE. – Mason Wheeler May 24 '10 at 16:07
2

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.

Francesca
  • 21,452
  • 4
  • 49
  • 90
  • This is delphi compared with delphi, so this is already compared with the same settings for D2006 and d2009/d2010. I share the OP's problem with my d2009. It sometimes locks up where d2006 didn't, or not as long. – Marco van de Voort May 23 '10 at 23:37
  • And you guarantee that you have the same project with the same uses and same paths? In my experience, switching to newer version of Delphi goes often with other modifications that are rarely without side effects. – Francesca May 24 '10 at 00:19
2

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!

Mark Robinson
  • 943
  • 9
  • 26