Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Mindtraveller is currently offline  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 #21087 is a reply to message #21041] Sun, 03 May 2009 17:27 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

:up:

Latest TheIDE version 902r186 : the same problem with lags.
Re: A little proposal on code analysis [message #21090 is a reply to message #21087] Sun, 03 May 2009 17:48 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I may create and upload screenshot-video if it`s needed. But I suppose many more people (with CPUs dating < 2003-2005) has the same problem too.

[Updated on: Sun, 03 May 2009 17:49]

Report message to a moderator

Re: A little proposal on code analysis [message #21091 is a reply to message #21090] Sun, 03 May 2009 18:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
What OS?

Screenshot might help.

Mirek
Re: A little proposal on code analysis [message #21092 is a reply to message #21091] Sun, 03 May 2009 18:53 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

luzr wrote on Sun, 03 May 2009 20:47

What OS?

Screenshot might help.

Mirek

Windows XP, SP2.

OK, I`ll make video ASAP. Single screenshot won`t help as it can`t show the lag itself.
Re: A little proposal on code analysis [message #21143 is a reply to message #21092] Tue, 05 May 2009 09:19 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

http://www.youtube.com/watch?v=SyIZ8UeybSQ

[Updated on: Tue, 05 May 2009 09:20]

Report message to a moderator

Re: A little proposal on code analysis [message #21199 is a reply to message #21143] Sat, 09 May 2009 08:49 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I can confirm that for SVN 1113, TheIDE has serious lag when typing. It does no appear for small projects. Try loading "ide".

Windows XP, MSC8, Core 2 Duo E6550, GeForce 8800 GT, 2GB RAM
Re: A little proposal on code analysis [message #21208 is a reply to message #21199] Sat, 09 May 2009 17:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Go to previous messageGo to next message
Mindtraveller is currently offline  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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Go to previous messageGo to next message
Mindtraveller is currently offline  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 #21223 is a reply to message #21208] Sun, 10 May 2009 09:29 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Yes, no change here either.

luzr wrote on Sat, 09 May 2009 18:39

OK, looks like having super fast machine is not always an advantage...



I consider my machine specs quite good for a desktop development machine. It is not an airplane or anything, but it was high end when I bought it and relatively expensive. I wouldn't consider compiling C++ on anything less. Yet I still have this delay which makes editing almost impossible.

What are you're hardware specs Mirek?

And could some people with high end machines check it out? This issue is hard to observe because I suspect only a handful of people keep their sources synced with latest SVN all the times.
Re: A little proposal on code analysis [message #21224 is a reply to message #21223] Sun, 10 May 2009 10:20 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Smile for such occasions....

Mirek
Re: A little proposal on code analysis [message #21243 is a reply to message #21224] Sun, 10 May 2009 19:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, performed tests on Sempron 1.6Ghz, 512MB RAM, XP, HD 5200rpm (quite slow machine IMO).

Without the patch, lag was quite noticeable.

Anyway, after patching, there still is some lag if I type really really fast (much faster than "default" autorepeat), but it is definitely better.

So I wanted to ask - did it got any better for you with patch? Smile

Mirek
Re: A little proposal on code analysis [message #21247 is a reply to message #21243] Sun, 10 May 2009 20:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
After a bit of thinking, I suggest that you would test plain LineEdit and then CodeEditor (yes, it can be used as normal widget without theide).

Something like:

#include <CodeEditor/CodeEditor.h>

using namespace Upp;

GUI_APP_MAIN {
	TopWindow win;
	LineEdit edit;
//	CodeEditor edit; //2nd test
//	edit.Highlight(CodeEditor::HIGHLIGHT_CPP);
	win.Add(edit.SizePos());
	win.Run();
}


(Add CodeEditor package...)

Try and report the lag....

Mirek
Re: A little proposal on code analysis [message #21250 is a reply to message #21247] Sun, 10 May 2009 21:28 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Tried this test. Everything is OK for both LineEdit and CodeEditor widgets: no lags (even for rather big files), even DnD duplication worked correctly all the time.
Re: A little proposal on code analysis [message #21254 is a reply to message #21250] Sun, 10 May 2009 22:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 10 May 2009 15:28

Tried this test. Everything is OK for both LineEdit and CodeEditor widgets: no lags (even for rather big files), even DnD duplication worked correctly all the time.


Thank, that means we have to dig in theide Smile

Has the patch improved situation? (It did for me). Or there is no noticeable difference?

(Now I am thinking, and I am really sorry to ask this question: Have you rebuild theide? OK, ok, just needed to check Smile

Mirek
Re: A little proposal on code analysis [message #21256 is a reply to message #21254] Sun, 10 May 2009 23:18 Go to previous messageGo to next message
Mindtraveller is currently offline  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

Re: A little proposal on code analysis [message #21258 is a reply to message #21256] Mon, 11 May 2009 00:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 10 May 2009 17:18


And again, thank you for quick responses and great support!


I am afraid my support lags... Sad I usually have just enough time and energy to scan "library" forums..

Anyway, these two bugs (this one and DnD) are bitch to resolve. Well, DnD is even worse as I see no signs of it on my machines. Maybe you could test some LOGs in CtrlCore?

Mirek
Re: A little proposal on code analysis [message #21259 is a reply to message #21258] Mon, 11 May 2009 01:43 Go to previous messageGo to previous message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

Mirek, I will help with anything I can - so testing LOGs is not a problem. I am only bound by amount of free time as I`m currently releasing big project for industrial automation.
BUT. I`ll try to do all debugging you ask within "rest" time breaks.
Previous Topic: Parser error sensitivity
Next Topic: Code assist default selection
Goto Forum:
  


Current Time: Thu Mar 28 19:32:53 CET 2024

Total time taken to generate the page: 0.01334 seconds