Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
3.0.1
-
Security Level: Public
-
KV: Oct 4 - Oct 24
Description
[root@hostname ~]# opreport -l /opt/couchbase/bin/memcached
|
CPU: Intel Westmere microarchitecture, speed 1596 MHz (estimated)
|
Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (No unit mask) count 100000
|
samples % symbol name
|
...
|
86 5.0175 get_logger
|
...
|
Logger is read every single time, on a hot path...
void LOG(EXTENSION_LOG_LEVEL severity, const char *fmt, ...) { |
char buffer[2048]; |
|
if (loggerApi != NULL) { |
EXTENSION_LOGGER_DESCRIPTOR* logger =
|
(EXTENSION_LOGGER_DESCRIPTOR*)loggerApi->get_logger();
|
...that does not seem reasonable.
As far as I can see from code, "extensions.logger" changes during startup, and does not change since then at all.
If there is any doubt to that, we could have used something similar to existing...
sapi->callback->register_callback(NULL, ON_LOG_LEVEL,
|
perform_callbacks(ON_LOG_LEVEL, NULL, NULL);
|
...infrastructure.
That would speed up Couchbase 5%, which is something very handsome for this price, what do you think?
Attachments
Issue Links
- relates to
-
MB-16391 oprofile) get_log_level on a hot path
- Closed