Author Topic: Really slow performance when deleting several lines  (Read 11122 times)

Offline skirby

  • Almost regular
  • **
  • Posts: 137
Really slow performance when deleting several lines
« 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Really slow performance when deleting several lines
« Reply #1 on: July 05, 2006, 01:45:18 pm »
Takes about half a second here (still way too much, though).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Really slow performance when deleting several lines
« Reply #2 on: July 05, 2006, 01:50:39 pm »
I can guess where it's coming from. Let me see...
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Really slow performance when deleting several lines
« Reply #3 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Really slow performance when deleting several lines
« Reply #4 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 :)
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Really slow performance when deleting several lines
« Reply #5 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:
« Last Edit: July 05, 2006, 02:13:36 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Really slow performance when deleting several lines
« Reply #7 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 ;)
« Last Edit: July 05, 2006, 02:31:05 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Really slow performance when deleting several lines
« Reply #8 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... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Really slow performance when deleting several lines
« Reply #9 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.
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Really slow performance when deleting several lines
« Reply #10 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? 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Really slow performance when deleting several lines
« Reply #11 on: July 06, 2006, 08:45:03 am »
Well, I knew you had some tests to run ;)
Be patient!
This bug will be fixed soon...

Offline skirby

  • Almost regular
  • **
  • Posts: 137
Re: Really slow performance when deleting several lines
« Reply #12 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