Only create network_instrumentation TracedValue if tracing enabled
Currently the TracedValues were being created even when the tracing category was disabled. This CL moves the creation of the TracedValues into a function, which is called only when the TRACE macro arguments are evaluated, which, in turn, only happens when the tracing category is enabled. Measuring on a linux workstation using the linux perf tools, the instrumentation overhead with the tracing category disabled is now below 2% of the cost of the ResourceFetcher::requestResource function, as opposed to the 12% measured before. Review-Url: https://codereview.chromium.org/2537143005 Cr-Commit-Position: refs/heads/master@{#437657}
Showing
Please register or sign in to comment