Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mirai on April 08, 2011, 05:11:48 pm

Title: Non-blocking CC
Post by: mirai on April 08, 2011, 05:11:48 pm
Current code completion implementation in CB blocks editor until it finds a solution. Sometimes it can disable CB editor for unacceptably long time. Is it possible to implement asynchronous non-blocking CC in low priority thread different from code editor thread? Besides, I think it would be OK to stop CC after defined time (a couple of seconds) if it didn't find a solution, because slow [and blocking] CC is almost as good as if it wasn't there in the first place.

Usually CC takes a long time to figure out things like this (the last line):
Code
class A
{
 public:
  A& x(/*args*/) { /*code*/ return *this; }
  A& y(/*args*/) { /*code*/ return *this; }
  A& z(/*args*/) { /*code*/ return *this; }
};

A a;

a.x().y().y().y().z().x().y().y().z();
Title: Re: Non-blocking CC
Post by: oBFusCATed on April 08, 2011, 06:02:06 pm
Probably it could be done.

But you're breaking a rule/principle for good OOP design, don't remember what exactly it was :)
So, this turn out as a feature of C::B's CC, not a bug :lol: :P (I'm joking of course)

Have you tried to lower the number of result you can have in the auto-completion list box?
The default is pretty high and if your query is too generic filling the list will be the most expensive operation.
Title: Re: Non-blocking CC
Post by: mirai on April 08, 2011, 08:35:34 pm
Have you tried to lower the number of result you can have in the auto-completion list box?
The default is pretty high and if your query is too generic filling the list will be the most expensive operation.
Thanks for the hint, it helped. Lower limit value made CC work time bearable.
Title: Re: Non-blocking CC
Post by: ptDev on April 09, 2011, 11:32:08 am
Have you tried to lower the number of result you can have in the auto-completion list box?
The default is pretty high and if your query is too generic filling the list will be the most expensive operation.
Thanks for the hint, it helped. Lower limit value made CC work time bearable.


I think the default value could be lowered to 8192 or a similar number, and most users would not notice any difference (except for the improved responsiveness).
Title: Re: Non-blocking CC
Post by: oBFusCATed on April 09, 2011, 11:50:46 am
I use 500 or something like that and when typing wx in C::B's project it is feeling slow :(