Author Topic: slow  (Read 20641 times)

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
slow
« on: July 26, 2007, 04:03:12 pm »
I think I've already read all the threads on this topic. CB is too slow on my Linux (Ubuntu 7.04) machine.
My system is:
AMD XP 2200+, gforce 6800GS with 9631 drivers.
Everything is quite fast: firefox, gedit, scite (the scintilla editor), ...
But entering text in CB is somewhat slow. It is lagging all the time.
I use rev 4321, nightly build 25.jul ubuntu package with wxWidgets 2.8.4

Any tricks to make it faster for me?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: slow
« Reply #1 on: July 26, 2007, 05:12:56 pm »
Hi !

You can disable unnecessary plugins: Plugins->Manage plugins...
CC, even if very useful, consumes a lot of time.

Dje

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #2 on: July 26, 2007, 08:39:19 pm »
I disabled every unnecessary plugin before doing the tests in the editor  :(
CC is disabled anyway, I dont like it^^

In addition, not only text input is lagging but marking text with the mouse is also damn slow.
« Last Edit: July 26, 2007, 08:41:00 pm by rotalever »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #3 on: July 26, 2007, 10:17:47 pm »
rotalever: you aren't the first to report these problems with linux. Personally, I've only seen the editor lag on my ubuntu laptop a few times. I always see large amounts of lag when I drag the management or log windows around. At first, I thought it was some event processing problem between Scintilla (the editor control) and wxAUI (the dock window manager) -- I couldn't isolate an obvious problem at the time so now I'm not so sure.

if you are willing to persevere, perhaps you could start by compiling CB yourself from source and see if you have better performance.
« Last Edit: July 26, 2007, 10:19:43 pm by dmoore »

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #4 on: July 26, 2007, 10:38:24 pm »
I thought about that, but CVS is disabled I do not know howto access SVN...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #5 on: July 26, 2007, 10:43:31 pm »
so long as you have the svn client installed it is easy:

http://developer.berlios.de/svn/?group_id=5358

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #6 on: July 26, 2007, 10:54:02 pm »
Thanks I will give it a try... Maybe tomorrow because it is late here...

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #7 on: July 27, 2007, 11:00:15 am »
I compiled it, created the deb packages, installed it and loaded my small document: Still way too slow  :(
It is such a good IDE... but too slow on linux.
Any idea what I could try?

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #8 on: July 27, 2007, 12:03:02 pm »
Ok, the problem has nothing todo with CB. I tested some examples from the wxwidget webpage. The HTML-Viewer and the textboxwidget are very slow, too. It is the same lag as in CB if you try to select some text.

Compiling wxwidgets on my own doesnt change anything.
« Last Edit: July 27, 2007, 02:55:05 pm by rotalever »

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #9 on: July 27, 2007, 06:02:54 pm »
In the wx forums they say I should use gtk1.x instead of gtk2. But then I should use wx 2.6.3 instead of 2.8.4 because of some refresh problems. I compiled wx 2.6.3 against gtk1.x and installed it. Works fine.

But now I have to recompile CB to work with wx2.6.3
Compiling outputs:
Code: [Select]
make[3]: Betrete Verzeichnis '/home/bla/software/codeblocks/src/sdk/wxFlatNotebook'
/bin/bash ../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA   -I../../../src/include/wxFlatNotebook/include  -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT wxFlatNotebook.lo -MD -MP -MF .deps/wxFlatNotebook.Tpo -c -o wxFlatNotebook.lo `test -f 'src/wxFlatNotebook/wxFlatNotebook.cpp' || echo './'`src/wxFlatNotebook/wxFlatNotebook.cpp
 g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA -I../../../src/include/wxFlatNotebook/include -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT wxFlatNotebook.lo -MD -MP -MF .deps/wxFlatNotebook.Tpo -c src/wxFlatNotebook/wxFlatNotebook.cpp  -fPIC -DPIC -o .libs/wxFlatNotebook.o
src/wxFlatNotebook/wxFlatNotebook.cpp: In member function 'virtual int wxPageContainer::HitTest(const wxPoint&, wxPageInfo&, int&)':
src/wxFlatNotebook/wxFlatNotebook.cpp:1125: error: 'class wxRect' has no member named 'Contains'
src/wxFlatNotebook/wxFlatNotebook.cpp:1134: error: 'class wxRect' has no member named 'Contains'
src/wxFlatNotebook/wxFlatNotebook.cpp:1138: error: 'class wxRect' has no member named 'Contains'
src/wxFlatNotebook/wxFlatNotebook.cpp:1145: error: 'class wxRect' has no member named 'Contains'
src/wxFlatNotebook/wxFlatNotebook.cpp:1162: error: 'class wxRect' has no member named 'Contains'
src/wxFlatNotebook/wxFlatNotebook.cpp:1190: error: 'class wxRect' has no member named 'Contains'
make[3]: *** [wxFlatNotebook.lo] Fehler 1
make[3]: Verlasse Verzeichnis '/home/bla/software/codeblocks/src/sdk/wxFlatNotebook'
So I cannot compile it...

Another thing:
I configured CB for compiling using "configure". It says I need to install gtk2-dev to compile. Why this??? It does not work with gtk2-dev? I thought it uses wxWidgets? And my wxWidgets is compiled against GTK1..

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #10 on: July 27, 2007, 08:24:57 pm »
Hmm, it really looks like if CB NEEDS GTK2... That is bad. I think GTK1 would have been fast enought.

Offline mikeandmore

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: slow
« Reply #11 on: July 29, 2007, 04:09:04 pm »
i personally think it is the CB's notebook widget that slow down the speed...

See i have tested the wxScintilla - which was used by CB - Sample on my computer, it works fine...
So I think is when you input something or drag something on the editor, the editor will produce an UPDATE_UI message the the FlatNoteBook.
and let the FlatNoteBook to redraw it...It's the redraw algrithm during the draw that slow down the speed.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: slow
« Reply #12 on: July 29, 2007, 04:52:17 pm »
Are you certain about this?

If you edit wxFlatNotebook.cpp, lines 771ff like this:
void wxPageContainer::OnPaint(wxPaintEvent & event)
{/*
   wxBufferedPaintDC dc(this);
   wxFNBRendererPtr render = wxFNBRendererMgrST::Get()->GetRenderer( GetParent()->GetWindowStyleFlag() );

   render->DrawTabs(this, dc, event);
*/}

does the problem persist?

We have postulated many times what might be causing this, update_ui messages being one thing, but rather firing off too many. However, most of this is theory so far, no really hard evidence.

If you could prove that it is the actual tab drawing code which causes the slowdown (if it disappears after commenting out that section), this would be great. Then Eran would probably be able to fix this issue by inserting 2-3 lines of code to filter out surplus events.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline eranif

  • Regular
  • ***
  • Posts: 254
Re: slow
« Reply #13 on: July 29, 2007, 05:23:27 pm »
I am using wxFlatNotebook on FC6, FC7 & Ubuntu 7.04 - all works fast.
To prove the point, I suggest running the demo application provided with wxFlatNotebook (which uses wxTextCtrl and not using wxScintilla).

If it is indeed wxFlatNotebook, I will be more than happy to fix it.

Eran

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: slow
« Reply #14 on: July 29, 2007, 07:39:20 pm »
Actually, I doubt it is wxFlatNotebook, rather I think it is our fault because we fire off too many events (and wxWidgets creates several copies of each on top).
But if it was really the drawing of wxFlatNotebook that caused the slowdown, we could really deem ourselves happy, finally having a pivot point. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #15 on: July 29, 2007, 08:11:27 pm »
Weird... I cannot compile it anymore.  :shock:
./configure:
Code: [Select]
checking for wx-config... no
configure: error:
                wxWidgets must be installed on your system.

                Please check that wx-config is in path, the directory
                where wxWidgets libraries are installed (returned by
                'wx-config --libs' or 'wx-config --static --libs' command)
                is in LD_LIBRARY_PATH or equivalent variable and
                wxWindows version is 2.6.0 or above.
wxWidgets is installed (2.8.4) with the official Packages. But wx-config is not available. That is unbelievable. I deinstalled wxWidgets and replaced it with a selfcompiled one. Now, I deinstalled that and installed wxWidgets as it was before.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #16 on: July 30, 2007, 06:09:12 pm »
Okay, wx-config has been in /etc...
Changing the suggested lines it is slightly faster but it is still lagging and way to slow. Besides, the interface is now unusable. It would be great, if I could compile it with gtk1 (-wxwidgets). That would make things faster.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #17 on: July 30, 2007, 08:04:24 pm »
Besides, the interface is now unusable.

that's because it was intended to isolate the cause, not be a fix...

I find it quite strange that CB is slow only on some machines/distros and not all. are you running 64bit or 32bit ubuntu? it could be a 64 bit problem. Alternatively, have you tried different graphics drivers? CB may be firing off too many events, but this might only cause significant delay on 64bit platforms or on machines with bad graphics drivers.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #18 on: July 31, 2007, 11:10:56 am »
that's because it was intended to isolate the cause, not be a fix...
Yeah, I know...  :D

As I said in my first post, I have an AMD XP2200+ which is a good old 32bit machine. My graphics drivers are those proprietary drivers from nvidia. The latest version, ubuntu provides. I really need those drivers because I am also developing with OpenGL.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #19 on: July 31, 2007, 01:30:28 pm »
Another two things I noticed:
Selecting text with the mouse...

....in the message window: quite fast/no lagging, nothing special about it

....in the editor window: slow/lagging, some noise comes out of my PC. I tested the HDD with wmhdplop -> It is not the HDD making the noise. What is it then? Maybe the graphics card, because it is the same noise I sometimes hear while using 3D applications...

You see the difference? The editor is really doing something stupid here!

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #20 on: July 31, 2007, 03:02:41 pm »
didn't you say some of the wx samples gave you problems (in which case it is not just the editor) or were they resolved when you compiled wx yourself?

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #21 on: July 31, 2007, 05:20:01 pm »
Yes, the wx sample from their homepage. The HTML viewer and the example which shows all the different widgets (->textbox widget). Both have the same problem if I select text with the mouse or edit it. Those examples have a build-in wx, selfcompiling wx changes nothing. I think self compiling wx will not make things that faster.
I have the problems in both samples and in the editor of CB. But the message window of CB is very fast...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #22 on: July 31, 2007, 06:35:42 pm »
well, i think the next step is to try running callgrind (part of valgrind) to see where the bottlenecks are. I suggest running on the html viewer sample spending a lot of time manipulating the laggy bits of the UI (it will take forever to do a callgrind on cb itself, especially in its non-functioning state). some of the other guys here might be able to tell you how to tune a callgrind run...

the other thing to try would be gradually commenting out/switching off various bits of the html viewer sample to isolate the cause of the lag.

also in cb, have you tried creating a new resource in wxSmith -- do you have lag in the wxSmith resource editor?

it's hard to help much more than this because i don't have a machine that has these problems... Unless there is a problem with a specific wx widget or feature there may be little than can be done by the cb devs.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #23 on: July 31, 2007, 08:13:12 pm »
it's hard to help much more than this because i don't have a machine that has these problems... Unless there is a problem with a specific wx widget or feature there may be little than can be done by the cb devs.
Yeah, thats true, but I asked this in the wxWidgets forums and someone said:
"I don't think anyone knows why, but wx apps using gtk2 do take a long time to render. There's no 'quick' fix for this. "
I can now profile the whole thing etc., but in my opinion this will not help. The user also said I should use GTK1 instead of GTK2 because it is much faster. I would do this, but CB does not compile with GTK1.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #24 on: July 31, 2007, 08:30:41 pm »
The user also said I should use GTK1 instead of GTK2 because it is much faster. I would do this, but CB does not compile with GTK1.

how about compiling a revision from before the recent update to the latest wxFlatNotebook? (I think it has introduced a number of incompatibilities with wx2.6.3). if that compiles then it shouldn't be too hard to come up with patches to the latest wxFlatnotebook.

try checking out rev 4310... (usual svn checkout command with additional option "-r 4310") (you could also svn update to it to save bandwidth, but that might create more hassles than it's worth)

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #25 on: July 31, 2007, 08:34:16 pm »

Offline Gimpmaster

  • Single posting newcomer
  • *
  • Posts: 4
Re: slow
« Reply #26 on: August 01, 2007, 07:07:15 am »
I just wanted to add that I am having the same slow problems.

He is also correct in saying that I can scroll and mouse select text extremely fast in the build messages window but trying to do so in the main editor window is dang slow as well as scrolling up and down with the cursor and arrow keys.

Disabling Code Completion does help but not a ton. Besides CC is the main reason why I'm using code blocks.

Hopefully a fix will find its way...thanks.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #27 on: August 01, 2007, 09:58:00 am »
You said I should use an older version of CB and tried that. But this doesnt compile with wxWidgets-GTk1 aswell.
Code: [Select]
make[4]: Betrete Verzeichnis '/home/aaaah/codeblocks4310/src/plugins/debuggergdb'
/bin/bash ../../../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA   -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12   -I../../../src/include -I../../../src/include/wxscintilla/include -I../../../src/include/scripting/include -I../../../src/include/scripting/sqplus  -Ulinux -Uunix  -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT gdb_tipwindow.lo -MD -MP -MF .deps/gdb_tipwindow.Tpo -c -o gdb_tipwindow.lo gdb_tipwindow.cpp
 g++ -DHAVE_CONFIG_H -I. -I../../../src/include -I/usr/lib/wx/include/gtk-ansi-release-2.6 -I/usr/include/wx-2.6 -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DNO_GCC_PRAGMA -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I../../../src/include -I../../../src/include/wxscintilla/include -I../../../src/include/scripting/include -I../../../src/include/scripting/sqplus -Ulinux -Uunix -O2 -ffast-math -g -O2 -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT gdb_tipwindow.lo -MD -MP -MF .deps/gdb_tipwindow.Tpo -c gdb_tipwindow.cpp  -fPIC -DPIC -o .libs/gdb_tipwindow.o
In file included from /usr/include/gtk-2.0/gtk/gtkobject.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkwidget.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkcontainer.h:33,
                 from /usr/include/gtk-2.0/gtk/gtkbin.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkwindow.h:33,
                 from /usr/include/gtk-2.0/gtk/gtkdialog.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:28,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from gdb_tipwindow.cpp:40:
/usr/include/gtk-2.0/gtk/gtktypeutils.h:66:1: warning: "GTK_CLASS_TYPE" redefined
In file included from /usr/include/glib-2.0/glib.h:68,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
                 from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from /usr/include/gtk-2.0/gtk/gtk.h:31,
                 from gdb_tipwindow.cpp:40:
/usr/include/glib-2.0/glib/gspawn.h:113:63: warning: this is the location of the previous definition
In file included from /usr/include/gtk-2.0/gtk/gtkwidget.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkcontainer.h:33,
                 from /usr/include/gtk-2.0/gtk/gtkbin.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkwindow.h:33,
                 from /usr/include/gtk-2.0/gtk/gtkdialog.h:32,
                 from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:28,
                 from /usr/include/gtk-2.0/gtk/gtk.h:32,
                 from gdb_tipwindow.cpp:40:
/usr/include/gtk-2.0/gtk/gtkobject.h:46:1: warning: "GTK_OBJECT_GET_CLASS" redefined
In file included from /usr/include/glib-2.0/glib.h:68,
                 from /usr/include/gtk-2.0/gdk/gdktypes.h:32,
                 from /usr/include/gtk-2.0/gdk/gdkcolor.h:31,
                 from /usr/include/gtk-2.0/gdk/gdkcairo.h:23,
                 from /usr/include/gtk-2.0/gdk/gdk.h:30,
                 from /usr/include/gtk-2.0/gtk/gtk.h:31,
                 from gdb_tipwindow.cpp:40:
/usr/include/glib-2.0/glib/gspawn.h:112:63: warning: this is the location of the previous definition
/usr/include/gtk-2.0/gdk/gdktypes.h:76: error: conflicting declaration 'typedef struct _GdkAtom* GdkAtom'
/usr/include/wx-2.6/wx/defs.h:2761: error: 'GdkAtom' has a previous declaration as 'typedef gulong GdkAtom'
/usr/include/gtk-2.0/gdk/gdktypes.h:102: error: conflicting declaration 'typedef struct _GdkDrawable GdkBitmap'
/usr/include/wx-2.6/wx/defs.h:2763: error: 'GdkBitmap' has a previous declaration as 'typedef struct _GdkWindow GdkBitmap'
/usr/include/gtk-2.0/gdk/gdktypes.h:103: error: conflicting declaration 'typedef struct _GdkDrawable GdkPixmap'
/usr/include/wx-2.6/wx/defs.h:2764: error: 'GdkPixmap' has a previous declaration as 'typedef struct _GdkWindow GdkPixmap'
/usr/include/gtk-2.0/gdk/gdktypes.h:104: error: conflicting declaration 'typedef struct _GdkDrawable GdkWindow'
/usr/include/wx-2.6/wx/defs.h:2762: error: 'GdkWindow' has a previous declaration as 'typedef struct _GdkWindow GdkWindow'
make[4]: *** [gdb_tipwindow.lo] Fehler 1
make[4]: Verlasse Verzeichnis '/home/aaaah/codeblocks4310/src/plugins/debuggergdb'

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: slow
« Reply #28 on: August 01, 2007, 10:02:43 am »
You said I should use an older version of CB and tried that. But this doesnt compile with wxWidgets-GTk1 aswell.

You're still using GTK2. Plus you're using ANSI build of wxGTK which is not the recommended.
Be a part of the solution, not a part of the problem.

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #29 on: August 01, 2007, 12:57:01 pm »
Howto disable GTK2 then?? I build wxWidgets with GTK1
Code: [Select]
../configure --disable-gtk2  --enable-optimise --enable-shared --disable-debug --disable-profile --prefix=/usr --with-gtk=1 --disable-unicode
But if I want to compile CB with this wxWidgets it says that it need GTK-2.0-dev. So installed the GTK2 development files for ubuntu.
And I do not know howto disable ansi, whatever this means...

Here is the output of CB's configure script if I deinstalled GTK-2.0-dev
Code: [Select]
checking for GTK2... configure: error: Package requirements (gtk+-2.0 >= 2.0.0) were not met:

No package 'gtk+-2.0' found
« Last Edit: August 01, 2007, 01:06:42 pm by rotalever »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: slow
« Reply #30 on: August 01, 2007, 01:01:56 pm »
But if I want to compile CB with this wxWidgets it says that it need GTK-2.0-dev. So installed the GTK2 development files for ubuntu.
And I do not know howto disable ansi, whatever this means...

So it means you need GTK+2 to compile C::B. ANSI build can be turned off using --enable-unicode
Be a part of the solution, not a part of the problem.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #31 on: August 01, 2007, 02:49:13 pm »
So it means you need GTK+2 to compile C::B.

... with the supplied C::B configure/makefiles.

it seems to me that they should be tweakable to work with GTK1.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #32 on: August 01, 2007, 04:42:02 pm »
configure.in contains:

Code: [Select]
if test "x$HAVE_PKG_CONFIG" = "xyes"; then
PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0)
fi

...

WX_GTK2_CFLAGS=
WX_GTK2_LIBS=

...

WX_BASENAME=`$WX_CONFIG_WITH_ARGS --basename`
case $WX_BASENAME in
    *wx_gtk*)
        AC_MSG_RESULT(wxGTK)
        WX_GTK2_CFLAGS="$GTK2_CFLAGS"
        WX_GTK2_LIBS="$GTK2_LIBS"
    ;;

so because none of that checking stuff seems to actually do anything specific to GTK2, try deleting

Code: [Select]
if test "x$HAVE_PKG_CONFIG" = "xyes"; then
PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.0.0)
fi

and see what errors you get.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: slow
« Reply #33 on: August 01, 2007, 06:52:49 pm »
configure.in contains:

Code: [Select]
.....

so because none of that checking stuff seems to actually do anything specific to GTK2
.......
and see what errors you get.


gtk2 is needed by the debugger's tooltips. The build will break there if you do this.
Be patient!
This bug will be fixed soon...

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #34 on: August 01, 2007, 07:53:23 pm »
can this be worked around with an #ifdef or two?

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #35 on: August 01, 2007, 08:20:31 pm »
gtk2 is needed by the debugger's tooltips. The build will break there if you do this.
How do you do this on windows then? With GTK2, too?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: slow
« Reply #36 on: August 02, 2007, 12:14:20 am »
gtk2 is needed by the debugger's tooltips. The build will break there if you do this.
How do you do this on windows then? With GTK2, too?

Funny. You 're free to fix it then, I don't have the time for it.
Be patient!
This bug will be fixed soon...

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #37 on: August 02, 2007, 10:26:24 am »
Funny. You 're free to fix it then, I don't have the time for it.
It's Ok, it's Ok  :). Maybe I will dive a bit into the code I find time.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #38 on: August 02, 2007, 04:06:06 pm »
taking a quick look, you should be able to just comment out these line of plugins/debuggergdb/gdb_tipwindow.cpp (at ~line 39):

Code: [Select]
#ifdef __WXGTK__
    #include <gtk/gtk.h>
#endif

and then make sure wxUSE_POPUPWIN is never #defined...

then bootstrap, configure (with the alteration i suggested earlier), make

Offline rotalever

  • Multiple posting newcomer
  • *
  • Posts: 23
Re: slow
« Reply #39 on: August 03, 2007, 09:18:29 am »
No this isnt working. I think there is no quick solution to make it faster / working without GTK2. If I comment too much out the debugger wont work anymore and so on.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #40 on: August 07, 2007, 04:46:56 am »
FYI - i managed to get gtk1.2 to compile using the above hacks. however, it:
* is butt ugly :)
* crashes almost immediately even in safemode. (get past the splash screen, cb starts to render then falls over)

from what i observed it is potentially faster, BUT, gtk1.2 doesn't support unicode, so it's not going to be very usable anyway.
« Last Edit: August 07, 2007, 06:45:08 am by dmoore »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: slow
« Reply #41 on: August 07, 2007, 11:38:05 pm »
The other day i talked to Yiannis about this slow bug. He told me he has never experienced it.  :shock: Any ideas of why it happens on some configs and why not on others?

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: slow
« Reply #42 on: August 08, 2007, 05:19:06 pm »
The other day i talked to Yiannis about this slow bug. He told me he has never experienced it.  :shock: Any ideas of why it happens on some configs and why not on others?

I think that ultimately, the problem is that linux has to support a whole host of hardware without the support of the hardware manufacturers. Add to this the multiple levels of GUI APIs: X, GTK, wxWidgets, which are all designed to operate slightly differently and its easy to see that small inefficiencies could scale up to massive problems on some hardware.

The proximate cause is probably the windows centric approach of wxWidgets, especially in its approach to drawing and managing windows, result in very inefficient calls to the underlying GUI APIs of non-windows systems. It could also be that wxWidgets linux support just isn't as mature as windows support and future versions will continue to improve in performance.

Personally, I run ubuntu linux 7.04 on a 1.7ghz speedstep laptop, which is my platform of choice for writing code. I've noticed that the GUI of wx apps just don't seem to perform as well as other apps, but I haven't had the same problems that, say, rotalever reported.

I leave as an exercise to the concerned reader writing a GTK native port of CB. there is an easy way to do this, but there isn't room in the margin to explain.  :lol:

Offline Trigve

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: slow
« Reply #43 on: August 11, 2007, 11:44:27 am »
Hi *,

I've encountered the same problem on my FreeBSD 6.2 box (In my case the CPU usage was 100% high when using arrows to move cursor form the beginnig to the end of the C++ file)... I've tried to find the bottlenecks causing the slowdown with PMC profiling... As was mentioned here, wxWidgets windows-like desgin has (I think) also some impact on this issue...

So when I was profiling the CB I've found some code blocks that was causing slowdowns (Don't remember everything cause it was 1 - 2 months ago and got only some notes written on the paper).

When I have commented the whole SurfaceImpl::MeasureWidth() in wxscitnilla/src/PlatWX.cpp, the CPU went down from 100 % -> 73% - 76%
Next, when I commented out the LayoutLine() operation in wxscintilla/src/scintilla/src/editor.cxx, usage went down to 63%.

I remember I've drop usage to nearly 10% with commenting some other functions (but editor was merely useless).

The PMC implementation I've used doesn't supported the call graphs...but things has changed and now I'm trying to build FreeBSD 7.0 with PMC with call graphs support added... then I'll try to profile CB again a find something new about the issue.

Trigve

Offline roshi

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: slow
« Reply #44 on: August 11, 2007, 04:57:42 pm »
Hi there
Nice to see that someone is working on this problem.
I noticed the CPU spike when scrolling since always.
Eats up 50% of both cores of my Dual Core 2GHz T7200
Apparently is something common to wxGTK apps.
Cuse I remember going through all linux available IDEs and at that time I noticed that some other wx based software also had the same problems.
"Native" stuff like IDEs based on gtk alone or based on QT seem to be unaffected...
Sniff sniff.
Too late to change lib so better just improve the one we have.
It really doesn't make sense. It's only scrolling... :)

Offline eranif

  • Regular
  • ***
  • Posts: 254
Re: slow
« Reply #45 on: August 11, 2007, 09:30:07 pm »
Hi,

I dont know if this is the same problem, but a year ago I had similar problem - using another application which used wxScintilla - and after some profiling I seem to found the root cause for that particular problem:
wxDC::GetTextExtent - On Linux is very slow. Removing the call to this function simply removed the problem.

This call was hiding when calling to wxScintilla::TextWidth() - avoiding this function simply fixes the problem.

this issue was reported here:
http://forums.codeblocks.org/index.php/topic,2869.45.html
search for my second reply from top (username: eranif)

Eran




Offline johne53

  • Regular
  • ***
  • Posts: 253
Re: slow
« Reply #46 on: August 23, 2007, 01:56:39 pm »
Sorry - this is quite a lengthy thread but I'd like to add my name to the list of users with this problem. C::B editor (typing / moving the carat around etc) is very slow under Linux (OpenSuse 10.2) but fine under Windows. Was it ever resolved whether or not there's a fix for the problem?