summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-01-03 22:57:28 +0100
committerLars Knoll <lars.knoll@qt.io>2019-02-08 21:55:16 +0000
commita65752c71bd25bbb66bf33d3a82f7901419c5d95 (patch)
treeb54c2092186f9066bed4ed1602ed2981d5122372 /src/corelib/global
parenta5a859e721e7a1d0c5a3ec6abe2db55d9144bb36 (diff)
Shave ~5% off from signal emission time
Refactor activate(), so that we eliminate almost all checks for signal hooks in the common case. Here are the benchmark numbers showing the improvement for 100M signal emissions without change with change string based connect: 3836 3693 pointer based connect: 4571 4510 not connected: 479 433 disconnected: 559 522 Change-Id: I394e6ea5d5bc96e298e8cc0c763eed78c8041876 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qtrace_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/global/qtrace_p.h b/src/corelib/global/qtrace_p.h
index 3d04a7311d..56d1f9a318 100644
--- a/src/corelib/global/qtrace_p.h
+++ b/src/corelib/global/qtrace_p.h
@@ -114,10 +114,12 @@
QT_BEGIN_NAMESPACE
#if defined(Q_TRACEPOINT) && !defined(QT_BOOTSTRAPPED)
+# define Q_HAS_TRACEPOINTS 1
# define Q_TRACE(x, ...) QtPrivate::trace_ ## x(__VA_ARGS__)
# define Q_UNCONDITIONAL_TRACE(x, ...) QtPrivate::do_trace_ ## x(__VA_ARGS__)
# define Q_TRACE_ENABLED(x) QtPrivate::trace_ ## x ## _enabled()
#else
+# define Q_HAS_TRACEPOINTS 0
# define Q_TRACE(x, ...)
# define Q_UNCONDITIONAL_TRACE(x, ...)
# define Q_TRACE_ENABLED(x) false