News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

slow

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

Previous topic - Next topic

Biplab

Quote from: rotalever on August 01, 2007, 12:57:01 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.

dmoore

Quote from: Biplab on August 01, 2007, 01:01:56 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.
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]

dmoore

configure.in contains:


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


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

mandrav

Quote from: dmoore on August 01, 2007, 04:42:02 PM
configure.in contains:


.....


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

dmoore

can this be worked around with an #ifdef or two?
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

Quote from: mandrav on August 01, 2007, 06:52:49 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?

mandrav

Quote from: rotalever on August 01, 2007, 08:20:31 PM
Quote from: mandrav on August 01, 2007, 06:52:49 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?

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

rotalever

Quote from: mandrav on August 02, 2007, 12:14:20 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.

dmoore

taking a quick look, you should be able to just comment out these line of plugins/debuggergdb/gdb_tipwindow.cpp (at ~line 39):


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

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.

dmoore

#40
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.
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]

rickg22

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?

dmoore

Quote from: rickg22 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?

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:
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]

Trigve

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

roshi

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