Author Topic: Non-blocking CC  (Read 4775 times)

Offline mirai

  • Multiple posting newcomer
  • *
  • Posts: 108
Non-blocking CC
« 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();

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Non-blocking CC
« Reply #1 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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mirai

  • Multiple posting newcomer
  • *
  • Posts: 108
Re: Non-blocking CC
« Reply #2 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.

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: Non-blocking CC
« Reply #3 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).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Non-blocking CC
« Reply #4 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 :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]