[go: nahoru, domu]

Don't track locks unless likely to block.

Chrome has a huge number of locks that are constantly acquired and
released.  Most acquisitions don't block and so having them "tracked"
by the ActivityTracker tends to be expensive with no possible benefit.

If tracking is enabled, simply "try" the lock first and skip the
(tracked) blocking call completely.

This fixes problems where some run-times were 9x longer than when
tracking is not enabled.

Bug: 777409
Change-Id: Ic132d50db094a7bfe25677fd35157d4473a106cd
Reviewed-on: https://chromium-review.googlesource.com/737858
Reviewed-by: Mark Mentovai <mark@chromium.org>
Reviewed-by: Sigurður Ásgeirsson <siggi@chromium.org>
Commit-Queue: Brian White <bcwhite@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511599}
6 files changed