Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: skirby on July 05, 2006, 01:39:36 pm

Title: Really slow performance when deleting several lines
Post by: skirby on July 05, 2006, 01:39:36 pm
Hello,

Is it me or C::B is really slow when you try to delete more than 100 lines in the same time.
On my computer, Windows 2000 sp4 with P4 2.8 Ghz with 2Go RAM it takes about 5 seconds to delete 150 lines.
More the CPU is used up to 80%

For information, I use the last nightly build:
Version 1.0 revision 2676 ()   gcc 3.4.5 Windows/unicode

I have done some test with older version and it seems that slow down problems have appeared since the The 14 June 2006 build
With the 13 June 2006 build => No problem
Since the 14 June 2006 build => Slow down problem when deleting lines

I hope you could reproduce and correct this problem.

Otherwise, do I have to post this problem on BerliOS site?

Thanks and have a nice day.
Title: Re: Really slow performance when deleting several lines
Post by: thomas on July 05, 2006, 01:45:18 pm
Takes about half a second here (still way too much, though).
Title: Re: Really slow performance when deleting several lines
Post by: mandrav on July 05, 2006, 01:50:39 pm
I can guess where it's coming from. Let me see...
Title: Re: Really slow performance when deleting several lines
Post by: thomas on July 05, 2006, 01:51:48 pm
I think it is coming from 2554 and 2557, both changes deal with updating breakpoints when lines are deleted.
Title: Re: Really slow performance when deleting several lines
Post by: mandrav on July 05, 2006, 01:53:04 pm
I think it is coming from 2554 and 2557, both changes deal with updating breakpoints when lines are deleted.

Yes, I know, thanks :)
Title: Re: Really slow performance when deleting several lines
Post by: MortenMacFly on July 05, 2006, 02:08:16 pm
I knew that this would happen - these lines are from me. :oops:
Anyway: mandrav: That's why I have proposed a RemoveBreakpoints method because only the debugger knows how to effectively remove breakpoints beyond the new EOF if lines are deleted from a file...
I still have my implementation of this at home... an interest?
With regards, Morten.

Edit: BTW: I just realiased that the TODO on top of the affected lines made in in SVN, too... :lol:
Title: Re: Really slow performance when deleting several lines
Post by: MortenMacFly on July 05, 2006, 02:11:41 pm
...and while working on that: Please don't forget:
http://forums.codeblocks.org/index.php?topic=3261.msg25801#msg25801
...and:
http://forums.codeblocks.org/index.php?topic=3261.msg26709#msg26709
:lol:
Title: Re: Really slow performance when deleting several lines
Post by: mandrav on July 05, 2006, 02:25:15 pm
I knew that this would happen - these lines are from me. :oops:
Anyway: mandrav: That's why I have proposed a RemoveBreakpoints method because only the debugger knows how to effectively remove breakpoints beyond the new EOF if lines are deleted from a file...
I still have my implementation of this at home... an interest?

I 'm working on it, as we speak.
I have opted for another route: I added the following function in the debugger plugins' interface:
Code
virtual void EditorLinesAddedOrRemoved(cbEditor* editor, int startline, int lines) = 0;

If you think about it, it's really up to the debugger to stay in sync with the editor. Not the editor's job to keep bugging the debugger to keep in sync ;)
Title: Re: Really slow performance when deleting several lines
Post by: MortenMacFly on July 05, 2006, 02:50:52 pm
If you think about it, it's really up to the debugger to stay in sync with the editor. Not the editor's job to keep bugging the debugger to keep in sync ;)
I fully agree on that. And in fact I had nearly the same arguments to the method, maybe the naming was bad. I assume you are still going to call this method from inside "cbEditor::OnEditorModified", right?! Anyway... we'll see as time passes by... ;-)
Title: Re: Really slow performance when deleting several lines
Post by: mandrav on July 05, 2006, 08:39:51 pm
OK, fix commited.
Much more simpler code, a lot faster and hopefully fixes all problems the old implementation had.
Morten, I 'm waiting for your comments.
Title: Re: Really slow performance when deleting several lines
Post by: MortenMacFly on July 05, 2006, 09:54:27 pm
Morten, I 'm waiting for your comments.
mandrav, you are the man. Remember the list I posted here: http://forums.codeblocks.org/index.php?topic=3276.msg25945#msg25945 (http://forums.codeblocks.org/index.php?topic=3276.msg25945#msg25945)? All the test cases that failed recently will now work just fine. I think this is another huge step towards RC3 because this was really annoying.
Well... no... very well... no... excellent done! :P
With regards, Morten.
Title: Re: Really slow performance when deleting several lines
Post by: mandrav on July 06, 2006, 08:45:03 am
Well, I knew you had some tests to run ;)
Title: Re: Really slow performance when deleting several lines
Post by: skirby on July 06, 2006, 07:28:29 pm
Thank you very much for your hard work.

I really love C::B and it becomes better each day   :D