qt5base-lts/src/corelib/global
Olivier Goffart 2be0d3088f qFormatLogMessage: optimize %{backtrace}
backtrace_symbols is very slow because it tries to find the function
name from the address. In order to do that it needs to do a linear search
over all symbols. (Because the hash table goes the other way to find the
address from the symbol name)

The code is going to skip a few frames from QtCore. Since we cannot know
how many, we take a few more than necessary.
This patch changes the additional number of frames from 15 to 7
(Usually, there are about 5 suppressed frames).

We call backtrace_symbols several times for only one frame at the time.
So we are not looking up addresses we don't need after we printed the
right number of frames.

Calling many times backtrace_symbols means we do more malloc, but that's
negligible compared to the time we save. We anyway do a lot of other
allocations because of the regexp operations and such

So this patch is then saving about 10 frames lookups which allow to print
about 6 qDebug per miliseconds instead of only 2 when using %{backtrace depth=2}

Change-Id: Ic6ece2145d53dc570c80fcb0e4455dcef6bc40cb
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
2015-02-14 18:43:35 +00:00
..
archdetect.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
global.pri Link against QMAKE_LIBS_EXECINFO when using backtrace(3). 2015-01-03 14:48:53 +01:00
qcompilerdetection.h Merge remote-tracking branch 'origin/5.4.1' into 5.4 2015-02-10 09:55:09 +01:00
qconfig-dist.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qconfig-large.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qconfig-medium.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qconfig-minimal.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qconfig-nacl.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qconfig-small.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qendian.h Fix compilation with Apple Clang 425 2015-02-09 06:55:51 +00:00
qendian.qdoc Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qfeatures.txt QPrinter - Make PDF support required for QPrinter 2013-11-27 21:06:30 +01:00
qflags.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qglobal.cpp Windows: Fix OS version determination for Windows >= 8 2015-01-07 09:17:18 +01:00
qglobal.h Bump version 2015-01-19 10:54:37 +01:00
qglobalstatic.cpp Doc: Use title case in section1 titles 2014-09-30 13:52:51 +02:00
qglobalstatic.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qhooks_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qhooks.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qisenum.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qlibraryinfo.cpp Merge 5.4 into 5.4.1 2015-01-16 21:02:26 +01:00
qlibraryinfo.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qlogging.cpp qFormatLogMessage: optimize %{backtrace} 2015-02-14 18:43:35 +00:00
qlogging.h Logging: Disable tracking of debug source info for release builds 2014-10-01 16:06:27 +02:00
qmalloc.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qnamespace.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qnamespace.qdoc Doc: Fixed date format doc bug in QDateTime/Qt namespace 2015-01-06 17:54:58 +01:00
qnumeric_p.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qnumeric.cpp Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qnumeric.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qprocessordetection.h Use __aarch64__ instead of __arm64__ to detect AArch64 2014-11-04 10:06:14 +01:00
qsysinfo.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qsystemdetection.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qt_pch.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qt_windows.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qtypeinfo.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qtypetraits.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00