News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

slow

Started by rotalever, July 26, 2007, 04:03:12 PM

Previous topic - Next topic

rotalever

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?

dje

Hi !

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

Dje

rotalever

#2
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.

dmoore

#3
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.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rotalever

I thought about that, but CVS is disabled I do not know howto access SVN...

dmoore

so long as you have the svn client installed it is easy:

http://developer.berlios.de/svn/?group_id=5358
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]

rotalever

Thanks I will give it a try... Maybe tomorrow because it is late here...

rotalever

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?

rotalever

#8
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.

rotalever

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:

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..

rotalever

Hmm, it really looks like if CB NEEDS GTK2... That is bad. I think GTK1 would have been fast enought.

mikeandmore

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.

thomas

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."

eranif

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

thomas

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."