Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disassembler performance is bad -> libQt5Gui #505

Closed
GitMensch opened this issue Sep 6, 2023 · 2 comments · Fixed by #538
Closed

Disassembler performance is bad -> libQt5Gui #505

GitMensch opened this issue Sep 6, 2023 · 2 comments · Fixed by #538
Labels

Comments

@GitMensch
Copy link
Contributor

Describe the bug
If using the disassembly function on a huge function, then hotspot stays at 100% cpu, which can (for huge functions) stay that way over an hour.

To Reproduce
open disassembly from huge program

Expected behavior
If it is too huge, possibly allow to use disassembly for a range of code lines.

Version Info (please complete the following information):

Additional context
pref recording for 30 seconds on the hotspot process, showing
grafik
perf.data.hotspot_disas.perfparser

Checking its stack by polling shows:

#0  0x00007f3b7aa78501 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#1  0x00007f3b7aa7991d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#2  0x00007f3b7aa815b7 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#3  0x00007f3b7aa81b8a in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#4  0x00007f3b7aa82158 in QTextDocumentLayout::doLayout(int, int, int) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#5  0x00007f3b7aa832bb in QTextDocumentLayout::documentChanged(int, int, int) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#6  0x00007f3b7aa5954f in QTextDocumentPrivate::finishEdit() () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#7  0x00000000004f220d in DisassemblyModel::setDisassembly (this=0xdf3130, disassemblyOutput=..., results=...)
    at /__w/hotspot/hotspot/src/models/disassemblymodel.cpp:68
#8  0x00000000004ae204 in ResultsDisassemblyPage::showDisassembly (this=0xd67dc0, disassemblyOutput=...) at /__w/hotspot/hotspot/src/resultsdisassemblypage.cpp:395
#9  0x00000000004ae5ed in ResultsDisassemblyPage::showDisassembly (this=0xd67dc0) at /__w/hotspot/hotspot/src/resultsdisassemblypage.cpp:360
#10 0x00007f3b7a4fc16d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#11 0x00000000004939e4 in ResultsPage::onJumpToDisassembly (this=0xcd6860, symbol=...) at /__w/hotspot/hotspot/src/resultspage.cpp:230
#12 0x00007f3b7a4fc16d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#13 0x000000000043f755 in ResultsCallerCalleePage::jumpToDisassembly (this=<optimized out>, _t1=...)
    at /__w/hotspot/hotspot/build/src/hotspot_autogen/EWIEGA46WW/moc_resultscallercalleepage.cpp:211
#14 0x00000000004b4460 in std::function<void (ResultsUtil::CallbackAction, Data::Symbol const&)>::operator()(ResultsUtil::CallbackAction, Data::Symbol const&) const (
    __args#1=..., __args#0=<optimized out>, this=0xf88160) at /opt/rh/devtoolset-11/root/usr/include/c++/11/bits/std_function.h:590
#15 operator() (__closure=0xf88120) at /__w/hotspot/hotspot/src/resultsutil.cpp:115
#16 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, ResultsUtil::setupContextMenu(QTreeView*, CostContextMenu*, int, FilterAndZoomStack*, ResultsUtil::CallbackActions, const std::function<void(ResultsUtil::CallbackAction, const Data::Symbol&)>&)::<lambda(QPoint)>::<lambda()> >::call (arg=<optimized out>,
    f=...) at /usr/include/QtCore/qobjectdefs_impl.h:146
#17 QtPrivate::Functor<ResultsUtil::setupContextMenu(QTreeView*, CostContextMenu*, int, FilterAndZoomStack*, ResultsUtil::CallbackActions, const std::function<void(ResultsUtil::CallbackAction, const Data::Symbol&)>&)::<lambda(QPoint)>::<lambda()>, 0>::call<QtPrivate::List<>, void> (arg=<optimized out>, f=...)
    at /usr/include/QtCore/qobjectdefs_impl.h:256
#18 QtPrivate::QFunctorSlotObject<ResultsUtil::setupContextMenu(QTreeView*, CostContextMenu*, int, FilterAndZoomStack*, ResultsUtil::CallbackActions, const std::function<void(ResultsUtil::CallbackAction, const Data::Symbol&)>&)::<lambda(QPoint)>::<lambda()>, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=0xf88110, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/QtCore/qobjectdefs_impl.h:443
#19 0x00007f3b7a4fc16d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#20 0x00007f3b7afc8ae2 in QAction::triggered(bool) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#21 0x00007f3b7afcb494 in QAction::activate(QAction::ActionEvent) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#22 0x00007f3b7b1411c2 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#23 0x00007f3b7b148821 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#24 0x00007f3b7b00d7ee in QWidget::event(QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#25 0x00007f3b7afceacf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#26 0x00007f3b7afd5f89 in QApplication::notify(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#27 0x00007f3b7a4c7a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#28 0x00007f3b7afd4b20 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
   from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#29 0x00007f3b7b026768 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#30 0x00007f3b7b028c95 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#31 0x00007f3b7afceacf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#32 0x00007f3b7a4c7a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#33 0x00007f3b7a933af7 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#34 0x00007f3b7a90b38c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#35 0x00007f3b69ee5d5a in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5XcbQpa.so.5
#36 0x00007f3b74aea119 in g_main_context_dispatch () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#37 0x00007f3b74aea478 in g_main_context_iterate.isra () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#38 0x00007f3b74aea52c in g_main_context_iteration () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#39 0x00007f3b7a51baa4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#40 0x00007f3b7a4c661b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#41 0x00007f3b7b146486 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#42 0x00007f3b7b146580 in QMenu::exec(QPoint const&, QAction*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#43 0x00000000004b563d in operator() (__closure=<optimized out>, point=...) at /__w/hotspot/hotspot/src/resultsutil.cpp:125
#44 0x00007f3b7a4fc16d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#45 0x00007f3b7aff4c55 in QWidget::customContextMenuRequested(QPoint const&) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#46 0x00007f3b7b00e66e in QWidget::event(QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#47 0x00007f3b7b0b67ee in QFrame::event(QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#48 0x00007f3b7a4c7812 in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#49 0x00007f3b7afceabe in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#50 0x00007f3b7afd58c4 in QApplication::notify(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#51 0x00007f3b7a4c7a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#52 0x00007f3b7b0263e4 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#53 0x00007f3b7b028c95 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#54 0x00007f3b7afceacf in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Widgets.so.5
#55 0x00007f3b7a4c7a9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#56 0x00007f3b7a933af7 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#57 0x00007f3b7a90b38c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#58 0x00007f3b69ee5d5a in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5XcbQpa.so.5
#59 0x00007f3b74aea119 in g_main_context_dispatch () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#60 0x00007f3b74aea478 in g_main_context_iterate.isra () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#61 0x00007f3b74aea52c in g_main_context_iteration () from /tmp/.mount_hotspoorVgho/usr/lib/libglib-2.0.so.0
#62 0x00007f3b7a51baa4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#63 0x00007f3b7a4c661b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#64 0x00007f3b7a4ce26c in QCoreApplication::exec() () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Core.so.5
#65 0x000000000043e9a5 in main (argc=<optimized out>, argv=<optimized out>) at /__w/hotspot/hotspot/src/main.cpp:260

and "always" stays over the 0x00007f3b7aa815b7 frame (I can "finish" until I get there, but "finish" from there seems not not exit (waited for some minutes).

#0  0x00007f3b7aa6e65c in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#1  0x00007f3b7aa784b7 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#2  0x00007f3b7aa7991d in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#3  0x00007f3b7aa815b7 in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#4  0x00007f3b7aa81b8a in ?? () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5
#5  0x00007f3b7aa82158 in QTextDocumentLayout::doLayout(int, int, int) () from /tmp/.mount_hotspoorVgho/usr/lib/libQt5Gui.so.5

Not sure if details in libQt5Gui would help, but those are not contained in the debuginfo and https://github.com/KDAB/hotspot/blob/master/HACKING.md#debugging-the-appimage has no details on that either.

@GitMensch
Copy link
Contributor Author

Related: #522

@lievenhey lievenhey linked a pull request Oct 23, 2023 that will close this issue
lievenhey added a commit that referenced this issue Oct 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Oct 31, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Oct 31, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Oct 31, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Oct 31, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 28, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Nov 30, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Dec 5, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
lievenhey added a commit that referenced this issue Dec 12, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
milianw pushed a commit that referenced this issue Dec 19, 2023
Using QTextDocument was a little bit overkill since we don't need rich
text support. This replaces it with a simple QTextLayout implementation.

closed: #522, #505
@GitMensch
Copy link
Contributor Author

Just wanted to congratulate you on the performance adjustments - using most current appimage the "time to disassembly" is heavily reduced and finally also useable for huge functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant