Summary: | dot files scrolling is very slow when bird's eye is enabled | ||
---|---|---|---|
Product: | [Applications] kgraphviewer | Reporter: | Yuri <yuri> |
Component: | general | Assignee: | Gaël de Chalendar (aka Kleag) <kleagg> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | kde |
Priority: | NOR | Keywords: | investigated, triaged |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
dot file demonstrating the problem
screenshot from kcachegrind showing problematic calls callgrind profile |
Description
Yuri
2012-09-30 18:38:31 UTC
Created attachment 74254 [details]
dot file demonstrating the problem
Only happens when bird's eye is enabled. With kgraphviewer 2.1.1 under Mageia 2, it scrolls normaly, even with bird eye view. Do you have the possibility to check with this version ? I tried to build the latest git version of kgraphviewer while my installed kde4 is the older version 4.8.4 and am getting the error: Linking CXX shared library ../../lib/libkgraphviewer.so /usr/bin/ld: cannot find -lgvc I made version 2.1.1 compile and run. Same problem: it is still very slow when bird's eye is enabled. All involved kde libs are from version 4.8.4 I profiled this situation with kcachegrind-cachegrind and found that for some reason 82% of time is spent in libz.so in functions inflate_fast, inflate_table, inflate. Each of them were called ~1 million times. see attached image of call graph. Created attachment 74274 [details]
screenshot from kcachegrind showing problematic calls
So it looks like it loads font from file over and over once per text drawing operation, not reusing it. (In reply to comment #8) > So it looks like it loads font from file over and over once per text drawing > operation, not reusing it. It also seems to be located in the Qt library FreeType fonts handling. Maybe it is limited to FreeBSD ? I think I'll have to ask their advice to Qt specialists. I'll do that as soon as possible. Thanks for your help in identifying clearly the problem. Is this issue still reproducible? It sounds like a font caching problem, either in Qt or libfreetype. This port has been dropped from the FreeBSD on 2014-02-27 due to the broken for over 6 months build. I also assume it didn't have enough interest. I will probably try to see if this port can be made to build, it will take some time. How widely is this package used in general? Any statistics? In other words, is its functionality really needed and not covered by some other packages? Also, while I am here, the first error immediately breaking the build is this: usr/local/include/graphviz/cgraph.h: In member function 'void KGraphEditor::openUrlLibrary(const KUrl&, KParts::ReadOnlyPart*)': /usr/local/include/graphviz/cgraph.h:263: error: too few arguments to function 'Agraph_t* agread(void*, Agdisc_t*)' /usr/ports/graphics/kgraphviewer/work/kgraphviewer-2.0.2-kde4.4.0/src/kgrapheditor.cpp:245: error: at this point in file *** [src/CMakeFiles/kgrapheditor.dir/kgrapheditor.o] Error code 1 Additionally, the port mentioned this: # Several problems at once here: # - The port does not include graphviz's include directory, assuming it is # always in the compiler's default path (ie. /usr/include). # - The port includes <graphviz/foo.h>, while code is expected to include # <foo.h> instead, and pass -I${LOCALBASE}/graphviz instead of just # -I${LOCALBASE} to the compiler. # - The code in the development repository does a better job at fixing the # problems above, but it still relies on the deprecated libgraph library that # graphics/graphviz in ports does not install anymore. Sorry, I probably should have given you more details. I've sent patches for the cgraph issue to the list just recently, but I have a suspicion that the only way to get them in is by taking over as a maintainer. As I have rather enoughto do I'm going through the bug tracker to estimate effort, interest and what kind of help I might get. I'm surprised about the include path issue though, it seems to me it uses pkg-config... So it looks like the upstream isn't maintained much too. This type of functionality isn't used much by the average linux user I guess. Maybe we just need to leave it as it is. Keep this bug open, because I can't even run it easily now. I now pushed the compile fixes. Testing both of these and re-testing of this issue would be welcome. Git commit 246130d975ae06c9d43f71495613c25879a757f0 by Milian Wolff. Committed on 19/06/2014 at 11:17. Pushed by mwolff into branch 'master'. Optimize: Disable semi-expensive debug output generation. This debug message was never used, but still constructed on every paint event. Getting rid of it makes this a bit faster. M +22 -11 src/part/canvaselement.cpp http://commits.kde.org/kgraphviewer/246130d975ae06c9d43f71495613c25879a757f0 Git commit 191609882d386616d1a4a83dfd06fd186e287b1f by Milian Wolff. Committed on 19/06/2014 at 11:49. Pushed by mwolff into branch 'master'. Optimize: Cache string keys used for attribute lookup. The string literal will otherwise be transformed into a QString, which requires two allocations (QString's data and the actual QChar* array in there). Saving this gives a noticeable boost, esp. considering how often these methods are being called during painting. M +2 -2 src/part/graphedge.cpp M +19 -6 src/part/graphelement.cpp M +37 -23 src/part/graphelement.h http://commits.kde.org/kgraphviewer/191609882d386616d1a4a83dfd06fd186e287b1f If current master is still slow, please give us some data. Record it using linux perf e.g.: perf record --call-graph dwarf kgraphviewer sample.dot # now scroll around, do whather that shows its slow # then close down kgraphviewer, a perf.data file is generated perf report | bzip2 > perf.log.bz2 # this will take some time Then upload the perf.log.bz2 and make it accessible to us. Yuri, can you confirm the commit solves the performance issue? If you can provide the information requested in comment #18, please add it. The current kgraphversion version (kgraphviewer-2.0.2-kde4.4.0.tar.bz2) doesn't build with the current version of graphviz-2.38.0 due to this error: /usr/ports/graphics/kgraphviewer/work/kgraphviewer-2.0.2-kde4.4.0/src/kgraphviewer.cpp:195:16: error: too few arguments to function 'Agraph_t* agread(void*, Agdisc_t*)' g = agread(fp); ^ kgraphviewer's page http://extragear.kde.org/apps/kgraphviewer/ link that points to "its KDE git repository" is broken: Internal Error So I can't locate kgraphviewer trunk. Hello, Yes, the last changes to kgv were in part to use the last versions of graphviz. Concerning the access to the repository, I have opened a sysadmin ticket: https://sysadmin.kde.org/tickets/index.php?page=tickets&act=view&id=XDD-7476 The kgraphviewer master url is git@git.kde.org:kgraphviewer (will this work as anonymous ?). Regards, Gaël ----- Mail original ----- > De: "Yuri" <yuri@tsoft.com> > À: kleag@free.fr > Envoyé: Lundi 18 Août 2014 20:14:17 > Objet: [kgraphviewer] [Bug 307632] dot files scrolling is very slow when bird's eye is enabled > > https://bugs.kde.org/show_bug.cgi?id=307632 > > --- Comment #21 from Yuri <yuri@tsoft.com> --- > The current kgraphversion version > (kgraphviewer-2.0.2-kde4.4.0.tar.bz2) doesn't > build with the current version of graphviz-2.38.0 due to this error: > /usr/ports/graphics/kgraphviewer/work/kgraphviewer-2.0.2-kde4.4.0/src/kgraphviewer.cpp:195:16: > error: too few arguments to function 'Agraph_t* agread(void*, > Agdisc_t*)' > g = agread(fp); > ^ > > kgraphviewer's page http://extragear.kde.org/apps/kgraphviewer/ link > that > points to "its KDE git repository" is broken: Internal Error > > So I can't locate kgraphviewer trunk. > > -- > You are receiving this mail because: > You are the assignee for the bug. > Wow! Sysadmins are really good! The ticket I opened is already closed with the problem fixed...
Gaël
----- Mail original -----
> De: "Gaël de Chalendar" <kleag@free.fr>
> À: kleag@free.fr
> Envoyé: Lundi 18 Août 2014 22:34:22
> Objet: [kgraphviewer] [Bug 307632] dot files scrolling is very slow when bird's eye is enabled
>
> https://bugs.kde.org/show_bug.cgi?id=307632
>
> --- Comment #22 from Gaël de Chalendar (aka Kleag) <kleag@free.fr>
> ---
> Hello,
>
> Yes, the last changes to kgv were in part to use the last versions
> of
> graphviz.
>
> Concerning the access to the repository, I have opened a sysadmin
> ticket:
> https://sysadmin.kde.org/tickets/index.php?page=tickets&act=view&id=XDD-7476
>
> The kgraphviewer master url is git@git.kde.org:kgraphviewer (will
> this work as
> anonymous ?).
>
> Regards,
>
> Gaël
>
> ----- Mail original -----
> > De: "Yuri" <yuri@tsoft.com>
> > À: kleag@free.fr
> > Envoyé: Lundi 18 Août 2014 20:14:17
> > Objet: [kgraphviewer] [Bug 307632] dot files scrolling is very slow
> > when bird's eye is enabled
> >
> > https://bugs.kde.org/show_bug.cgi?id=307632
> >
> > --- Comment #21 from Yuri <yuri@tsoft.com> ---
> > The current kgraphversion version
> > (kgraphviewer-2.0.2-kde4.4.0.tar.bz2) doesn't
> > build with the current version of graphviz-2.38.0 due to this
> > error:
> > /usr/ports/graphics/kgraphviewer/work/kgraphviewer-2.0.2-kde4.4.0/src/kgraphviewer.cpp:195:16:
> > error: too few arguments to function 'Agraph_t* agread(void*,
> > Agdisc_t*)'
> > g = agread(fp);
> > ^
> >
> > kgraphviewer's page http://extragear.kde.org/apps/kgraphviewer/
> > link
> > that
> > points to "its KDE git repository" is broken: Internal Error
> >
> > So I can't locate kgraphviewer trunk.
> >
> > --
> > You are receiving this mail because:
> > You are the assignee for the bug.
> >
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Now I compiled kgraphviewer trunk, and command 'kgraphviewer sample.dot' hangs with this stack: (gdb) bt #0 0x0000000804f2f35a in select () from /lib/libc.so.7 #1 0x0000000804bd4ae2 in select () from /lib/libthr.so.3 #2 0x00000008034eef20 in KLockFile::lock(QFlags<KLockFile::LockFlag>) () from /usr/local/lib/libkdecore.so.5 #3 0x0000000803339190 in KConfigIniBackend::lock(KComponentData const&) () from /usr/local/lib/libkdecore.so.5 #4 0x00000008033220b2 in KConfig::sync() () from /usr/local/lib/libkdecore.so.5 #5 0x00000008033a2552 in KDebugPrivate::writeGroupForNamedArea(QByteArray const&, bool) () from /usr/local/lib/libkdecore.so.5 #6 0x00000008033a1efe in KDebugPrivate::areaData(QtMsgType, unsigned int, bool) () from /usr/local/lib/libkdecore.so.5 #7 0x00000008033a188f in KDebugPrivate::stream(QtMsgType, unsigned int, char const*, int, char const*) () from /usr/local/lib/libkdecore.so.5 #8 0x00000008033a05a1 in kDebugStream(QtMsgType, int, char const*, int, char const*) () from /usr/local/lib/libkdecore.so.5 #9 0x0000000801ef196b in KXMLGUIClient::setXMLFile(QString const&, bool, bool) () from /usr/local/lib/libkdeui.so.5 #10 0x000000000040da74 in KGraphViewerWindow::KGraphViewerWindow (this=0x80b5b1900) at /usr/ports/graphics/kgraphviewer/yuri-kgraphviewer-git/src/kgraphviewer.cpp:62 #11 0x000000000040bfd3 in main (argc=<optimized out>, argv=<optimized out>) at /usr/ports/graphics/kgraphviewer/yuri-kgraphviewer-git/src/main.cpp:119 kdelibs-4.12.5_3 It (strangely) hanged this way first several times, and now it works. The original scrolling problem is gone. You should make a release, and then I can also suggest FreeBSD to restore the corresponding port (it was deleted in spring due to it being broken). Oops, forgot the bird's eye part. With bird's eye view it is is still extremely slow. Created attachment 88314 [details]
callgrind profile
I don't have 'perf' command on FreeBSD box where I see the problem. Instead attaching valgrind/callgrind profile.
Please view it with kcachegrind profile.
inflate_fast/inflate_table/inflate from libz.so take most of the time.
Required information provided. With current version 2.1.90 on KDE Neon and also with the current master, the provided samble scrolls very efficiently with or without the bird's eye view. Do you still encounter the problem ? This bug has had its resolution changed, but accidentally has been left in NEEDSINFO status. I am thus closing this bug and setting the status as RESOLVED to reflect the resolution change. |