From a65752c71bd25bbb66bf33d3a82f7901419c5d95 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 Jan 2019 22:57:28 +0100 Subject: 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) --- src/corelib/global/qtrace_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/global') 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 -- cgit v1.2.3