Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » A little proposal on code analysis
A little proposal on code analysis [message #21041] |
Tue, 28 April 2009 10:40 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
It looks like code analysis (or some kind of processing) is made each time key is pressed in the code editor. This makes TheIDE lagging on slower machines (even on my /rather old/ AMD 2GHz) when I type quickly enough. It looks like this: when I type a number of symbols quickly, they are not shown. They are drawn (all at once) after a period of about 0.5 seconds after last symbol was typed. This makes little discomfort as you can`t immediately observe text typed, and one have to wait for this lag each time he types anything.
I suppose this lag is caused by TheIDE calls code processing every time user changes the text. My proposal is to call code processing after symbols were drawn in the window and also if I type symbols one by one without stop, the code processing should be called after some timeout to minimize it`s call count.
[Updated on: Tue, 28 April 2009 10:42] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: A little proposal on code analysis [message #21208 is a reply to message #21199] |
Sat, 09 May 2009 17:39 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
OK, looks like having super fast machine is not always an advantage...
Anyway, I believe I have found a culprit. Please check this fix:
void Ide::InsertMenu(Bar& bar)
{
if(bar.IsScanKeys())
return;
bar.Add("Insert color..", THISBACK(InsertColor));
int pi = GetPackageIndex();
const Workspace& wspc = IdeWorkspace();
if(pi >= 0 && pi < wspc.GetCount()) {
String pn = wspc[pi];
const Package& p = wspc.GetPackage(pi);
int n = 0;
for(int i = 0; i < p.GetCount() && n < 12; i++) {
String fn = p[i];
String ext = ToLower(GetFileExt(fn));
String pp = pn + '/' + fn;
if(ext == ".lay") {
bar.Add(fn + " include", THISBACK1(InsertLay, pp));
n++;
}
if(ext == ".iml") {
String c = GetFileTitle(fn);
c.Set(0, ToUpper(c[0]));
bar.Add(fn + " include", THISBACK2(InsertIml, pp, c.EndsWith("Img") ? c : c + "Img"));
n++;
}
if(ext == ".tpp") {
bar.Add(fn + " include", THISBACK1(InsertTpp, pp));
n++;
}
}
}
}
Mirek
|
|
|
Re: A little proposal on code analysis [message #21215 is a reply to message #21208] |
Sat, 09 May 2009 23:42 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
Regretfully it didn`t help. Code editing still lags with this update.
One of the tests: while in code editor, make new line with Enter, write //, then press '=' key and do not release it. A sequence of '=' symbols will be added, but not displayed (this is TheIDE lag), wait a while, then release the key, then all the symbols are being displayed, all at once. Correct behaviour should be displaying each symbol immediately after it was added.
test config: AMD Athlon 2.1 GHz, WinXP SP2, SVN 1151 + patch, TheIDE compiled with MSC9 (GUI MT).
[Updated on: Sat, 09 May 2009 23:58] Report message to a moderator
|
|
|
Re: A little proposal on code analysis [message #21218 is a reply to message #21215] |
Sun, 10 May 2009 08:39 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
Mindtraveller wrote on Sat, 09 May 2009 17:42 | Regretfully it didn`t help. Code editing still lags with this update.
One of the tests: while in code editor, make new line with Enter, write //, then press '=' key and do not release it. A sequence of '=' symbols will be added, but not displayed (this is TheIDE lag), wait a while, then release the key, then all the symbols are being displayed, all at once. Correct behaviour should be displaying each symbol immediately after it was added.
test config: AMD Athlon 2.1 GHz, WinXP SP2, SVN 1151 + patch, TheIDE compiled with MSC9 (GUI MT).
|
Well, for record, displaying is not necessarry wrong behaviour, U++ (and most othre GUIs) are designed this way since first MacOS.
The idea is that screen repainting is as lazy as possible - it is done only is no other input event is in the queue for processing. Better lag repainting than miss keystroke, right?
Anyway, if you still observe lag, I will have to dig deeper I guess. There definitely should not be any lag in this case.
Mirek
|
|
|
Re: A little proposal on code analysis [message #21220 is a reply to message #21218] |
Sun, 10 May 2009 08:59 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
luzr wrote on Sun, 10 May 2009 10:39 | Well, for record, displaying is not necessarry wrong behaviour, U++ (and most othre GUIs) are designed this way since first MacOS.
| I agree with this approach in general but in this case it is important as U++ is positioned as agile and very effective development platform. Any new members will test U++ by using TheIDE. And making it lag is not the best thing for U++ reputation. We already do have Qt which (since version 4) became monstrouse and lagging. U++ could fit into the market of more effective frameworks but this presumes i.e. effectiveness of TheIDE (if development IDE breaks, how could I possible wite effective programs with this framework - one will ask himself).
IMO the most lazy thing should be could analysis.
Less lazy is GUI changing (I mean status bar, menu, etc.).
But keyboard/mouse respond is to be immediate - it is vital consumer appeal and a "face" of U++, especially for newcomers.
P.S. Even latest M$ Studio 2009` code editor doesn`t lag on my (and even older) PC`s. Good for Balmer. )
[Updated on: Sun, 10 May 2009 09:10] Report message to a moderator
|
|
|
|
Re: A little proposal on code analysis [message #21224 is a reply to message #21223] |
Sun, 10 May 2009 10:20 |
|
mirek
Messages: 14039 Registered: November 2005
|
Ultimate Member |
|
|
Well, cool down, there is no fundamental reason for this to be slow.
If it (still) lags, there is some problem, most likely in theide code, that has to be fixed.
I am now sitting at 2Ghz/2GB Core 2 notebook, so no speedster at all, although probably bit faster than 2.1 Ghz Athlon. (My desktop is 3.2Ghz Core 2 Quad, which is not the i7, but it is pretty to notice any lag...)
Well, on this notebook, I have noticed faint lag when autorepeat. Above patch fixed it completely. (Makes me even wonder if you have applied patch correctly.. which is more than likely, I know).
I guess I will have to finally setup my "slow machine" (I have some nice old Celeron 400 ready for such occasions....
Mirek
|
|
|
|
|
|
|
Re: A little proposal on code analysis [message #21256 is a reply to message #21254] |
Sun, 10 May 2009 23:18 |
Mindtraveller
Messages: 917 Registered: August 2007 Location: Russia, Moscow rgn.
|
Experienced Contributor |
|
|
1. Yes, patch decreased the lags. I just need some time to test it in a more careful way. But at first glance, yes, there is difference.
Writing program text seems much better while autorepeat is still drawn only after I release the key (but as I told - it`s need to be tested better).
2. I`ve just re-checked: yes, TheIDE is from SVN, patched and recompiled and is certainly executed (not the old one).
UPDATE: No, sorry, the lag is still there even w/o autorepeat. Maybe a little smaller, but yet annoying.
And again, thank you for quick responses and great support!
[Updated on: Sun, 10 May 2009 23:31] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 10:13:27 CEST 2024
Total time taken to generate the page: 0.08051 seconds
|