Author Topic: editor performance  (Read 11161 times)

Offline u2227

  • Single posting newcomer
  • *
  • Posts: 9
editor performance
« on: September 27, 2008, 09:30:30 am »
Hi,

I am using CB on FreeBSD and Ubuntu. I foudn one very annoying problem, the editor is slow, slower than any other editor around, UltimateC++, KDevelop, Eclipse - all are much faster. When I mean slow, I simply mean a redraw cycle speed. It looks like 3-7 FPS, just select text with the mouse and move mouse around you will see what I mean. Any other editor I know does more than 20 fps. But now the interesting part, when I go to "Settings" -> "Editor" -> "Syntax highlite" there is a builting mini viewer to help customizing colors. I suggest this is the same control as used for code editing, but it's FPS is magnitude faster! It is read only though, and may be my assumption is wrong, it is another control, but it looks very similar to the real editor. So my question anyone into this? What makes editor so slow? Maybe it is possible to recompile with soem slow making feature disabled? Maybe this is colorizer? But when you move mouse to select text, you do not need colorizer update, or you need? Then maybe option like "Smart syntax highliter update" would be good? But yet again, I only have few lines of text, this must be something else, even colorizing each frame would be dazzling fast.
I tried to look into code, but as always with "free software" you can of course modify it fo ryour needs.. but it will take days and months to get into the code base just to understand what is what. Learn wxWidgets again.
Any way thanks for reading this blunt.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: editor performance
« Reply #1 on: September 30, 2008, 07:47:32 pm »
Code Completion is slow on Code::Blocks are testing with it off?

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline u2227

  • Single posting newcomer
  • *
  • Posts: 9
Re: editor performance
« Reply #2 on: October 01, 2008, 09:34:58 pm »
No, I have code completion disabled.
Settings -> editor -> Code completion -> Disable code completion


Do you know the internals, is the syntax highlite demo in "Settings -> editor -> Syntax hilite" is the same control as the editor itself? Why sucj drastic difference?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: editor performance
« Reply #3 on: October 01, 2008, 09:44:15 pm »
It's the same control (scintilla). One difference is the huge number of wxWidgets events that CB generates and responds to (some but not all of these are directly related to the editor) while you edit. For whatever reason, wxWidgets event handling on GTK platforms may be very inefficient. The wrapper code around the scintilla control, wxscintilla, could be contributing to those problems...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: editor performance
« Reply #4 on: October 01, 2008, 09:51:36 pm »
I should also mention that these lag issues have been reported many times before (search the forums for slow editor). The issue is hard to resolve because it seems only a small % of people experience it (and none of the major devs). One guy thought he had isolated the problem to systems that were using KDE as the main desktop environment:

http://forums.codeblocks.org/index.php/topic,7155.msg55660.html#msg55660


Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: editor performance
« Reply #5 on: October 11, 2008, 08:54:53 pm »
I know you have "disabled" code completion in the editor, but have you tried going to the "manage plugins" menu item and disable the code completion plugin as a whole? From what I can recall, the code completion plugin also does funny stuff whenever you move the mouse.

Offline Joh

  • Single posting newcomer
  • *
  • Posts: 4
Re: editor performance
« Reply #6 on: October 19, 2008, 06:17:37 pm »
I have this problem aswell, but I think it got more severe the last week. The "only" things I've changed is upgrading Ubuntu from 8.04 to 8.10 beta, and compiling a new revision of Code::Blocks from SVN. Can't remember the old revision number though, but i think it was 526x and now I have 5273.

It doesn't seem to be a plugin. I just disabled every single plugin installed and it's still slow. It doesn't seem to apply only to users with KDE as their main desktop environment as I don't even have KDE installed (other than their libs). Turning off compositing increased it's performance quite a bit though. It's still slower than you'd expect, but it's bearable. However I don't want to turn off compositing every single time I want to use Code::Blocks, since it's just an editor after all.

I also have redraw issues with compositing turned on, issues I didn't have before. It won't redraw when it's supposed to. Like, if I select a bunch of text and then click somewhere to deselect it, it still shows as selected but the caret appears where I clicked. If I then press any key, it redraws and the selection dissappears (not the text, the background color is restored to normal).

Edit: I just tested some more, and noticed a few things. Both problems happen to regular text files as well as code files. Also, the redraw issue doesn't kick in until I've reached 35 lines of text.

Edit 2: Ignore the redraw issue, it seems to affect most Gtk apps in Ubuntu 8.10 as of now, todays updates seem to have fixed it.
« Last Edit: October 19, 2008, 07:12:11 pm by Joh »

Offline SiegeLord

  • Single posting newcomer
  • *
  • Posts: 7
    • SiegeLord's Abode
Re: editor performance
« Reply #7 on: November 01, 2008, 08:02:37 pm »
I've noticed the slowness appear only after the nightlies switched to the new wxWidgets version. Any revision before that, including 8.02 proper are nice and snappy, while anything after the revision when the new wxWidgets was incorporated was slow.

Perhaps someone can confirm this behaviour and then see what changes were made due to the upgrade of wxWidgets and attempt to fix this?

Offline MrPrise

  • Single posting newcomer
  • *
  • Posts: 8
Re: editor performance
« Reply #8 on: November 22, 2008, 02:20:33 pm »
Hello,
I'm using the latest SVN build (5317) with wx 2.8.8 on Ubuntu Intrepid Ibex and my editor is slow too.
I tried to disable the plugins but does not help.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: editor performance
« Reply #9 on: January 04, 2009, 02:40:43 pm »
I haven't feel it's editor performance is slow, my system is windows XP. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Hans Henrik

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: editor performance
« Reply #10 on: January 05, 2009, 06:50:28 pm »
i feel that the editor is slow when writing fast on big files...
(writing Really fast, with autoIt)

HotKeySet("ø", "DoStuffv2")
Func DoStuffv2() ; DoStuff version 2
$Name = "HHB_EXHAUST_BUGFIX"
Send("{SHIFTDOWN}{DOWN}{LEFT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{BACKSPACE}")
$inCopy = ClipGet()
$inCopy2 = StringRegExpReplace($inCopy, "^[ \t]+", "")
; CUS CODE::BLOCKS CANT TAKE IT THIS FAST ='(
Send("{SHIFTDOWN}3{SHIFTUP}ifdef " & $Name & "{ENTER}" & $inCopy & "{ENTER}{SHIFTDOWN}3{SHIFTUP}else // if not " & $Name & "{ENTER}" & $inCopy2 & "{ENTER}{SHIFTDOWN}3{SHIFTUP}endif // " & $Name)

EndFunc

while 1
sleep (1000)
Wend.

will freeze codeblocks and make it come up with lots of weird "white boxes" in big files

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: editor performance
« Reply #11 on: January 06, 2009, 02:09:49 am »
i feel that the editor is slow when writing fast on big files...
(writing Really fast, with autoIt)

HotKeySet("ø", "DoStuffv2")
Func DoStuffv2() ; DoStuff version 2
$Name = "HHB_EXHAUST_BUGFIX"
Send("{SHIFTDOWN}{DOWN}{LEFT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{BACKSPACE}")
$inCopy = ClipGet()
$inCopy2 = StringRegExpReplace($inCopy, "^[ \t]+", "")
; CUS CODE::BLOCKS CANT TAKE IT THIS FAST ='(
Send("{SHIFTDOWN}3{SHIFTUP}ifdef " & $Name & "{ENTER}" & $inCopy & "{ENTER}{SHIFTDOWN}3{SHIFTUP}else // if not " & $Name & "{ENTER}" & $inCopy2 & "{ENTER}{SHIFTDOWN}3{SHIFTUP}endif // " & $Name)

EndFunc

while 1
sleep (1000)
Wend.

will freeze codeblocks and make it come up with lots of weird "white boxes" in big files


The font of your post is too small. I tried IE and FF, but it's the same.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: editor performance
« Reply #12 on: January 10, 2009, 01:46:36 am »
He wrote:
Code
HotKeySet("ø", "DoStuffv2")
Func DoStuffv2() ; DoStuff version 2
$Name = "HHB_EXHAUST_BUGFIX"
Send("{SHIFTDOWN}{DOWN}{LEFT}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{BACKSPACE}")
$inCopy = ClipGet()
$inCopy2 = StringRegExpReplace($inCopy, "^[ \t]+", "")
; CUS CODE::BLOCKS CANT TAKE IT THIS FAST ='(
Send("{SHIFTDOWN}3{SHIFTUP}ifdef " & $Name & "{ENTER}" & $inCopy & "{ENTER}{SHIFTDOWN}3{SHIFTUP}else // if not " & $Name & "{ENTER}" & $inCopy2 & "{ENTER}{SHIFTDOWN}3{SHIFTUP}endif // " & $Name)

EndFunc

while 1
sleep (1000)
Wend.

will freeze codeblocks and make it come up with lots of weird "white boxes" in big files

Offline Kalith

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: editor performance
« Reply #13 on: January 10, 2009, 03:53:01 pm »
Hum, just reporting the same problem on Ubuntu, from the very first version I had to the latest one (8.10 I think).
I've installed Ubuntu a few months ago, so I can't tell when this problem appeared.
But it is actually really annoying, because text selection is laggy : sometimes you select less text than you'd expect.