New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601572 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Improve performance of accessing existing histograms.

Project Member Reported by bcwh...@chromium.org, Apr 7 2016

Issue description

Version: All
OS: All

There are many places where caching a pointer to a histogram isn't practical resulting in FactoryGet() and an associated FindHistogram() call.

See if the performance of this can be improved.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fca9ef5451d1dc700bbf2370e1147b05ad704cfc

commit fca9ef5451d1dc700bbf2370e1147b05ad704cfc
Author: bcwhite <bcwhite@chromium.org>
Date: Thu Apr 07 22:06:23 2016

Use strings for keys in the histogram map.

Using the MD5 hash of the name for the key makes for an
efficient mapping but calculating that hash is expensive.

A simple string-compare that first checks the length
cuts over 40% off the run-time according to the timing
tests. And since timing tests are skewed towards names
of only a few distinct lengths, the real-world
improvement should be even more.

BUG=601572

Review URL: https://codereview.chromium.org/1866423002

Cr-Commit-Position: refs/heads/master@{#385893}

[modify] https://crrev.com/fca9ef5451d1dc700bbf2370e1147b05ad704cfc/base/metrics/statistics_recorder.cc
[modify] https://crrev.com/fca9ef5451d1dc700bbf2370e1147b05ad704cfc/base/metrics/statistics_recorder.h

Sign in to add a comment