Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Issue 12572005: Reorder checks in tcmalloc. (Closed)

Created:
7 years, 9 months ago by gpike
Modified:
7 years, 9 months ago
CC:
chromium-reviews, dmikurube+memory_chromium.org, cmtice, llozano
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Reorder checks in tcmalloc. One of our local changes to tcmalloc is logic to reject all allocations above a certain size. (At least those via malloc and so on.) The check for that doesn't need to be on the hot path. Most allocations are small and there is a special case for that already. If that special case applies then we don't need to check if the allocation is gigantic. This is a performance tuning change. It doesn't affect functionality. To evaluate this change I ran 3 page cyclers: bloat, dhtml, and morejs. I used ChromeOS on the Samsung 550. I ran 30 trials; a few randomly failed, but I got close to 30 "before" and "after" results for each of those 3 tests. Results in order of p-value were: Bloat 0.3% faster, p=0.02 DHTML 0.3% faster, p=0.46 MoreJS 0.1% faster, p=0.82 This looks like a useful gain, but it's small, as one would expect. BTW I'm trusting the compiler to rewrite (x < (constant0)) && (x < (constant1)) to (x < (the smaller of the two constants)) I checked the generated code, and it looks good (at least on the ChromeOS toolchain for Samsung 550). BUG=111726 TEST=none R=jar Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=189321

Patch Set 1 #

Patch Set 2 : Now with correct indentation. #

Total comments: 3

Patch Set 3 : Added an ASSERT. Removed Jim's TODO. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+24 lines, -24 lines) Patch
M third_party/tcmalloc/chromium/src/tcmalloc.cc View 1 2 2 chunks +24 lines, -24 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
jar (doing other things)
nit suggestion and comment below. https://codereview.chromium.org/12572005/diff/2001/third_party/tcmalloc/chromium/src/tcmalloc.cc File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): https://codereview.chromium.org/12572005/diff/2001/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1092 third_party/tcmalloc/chromium/src/tcmalloc.cc:1092: if (size <= kMaxSize ...
7 years, 9 months ago (2013-03-15 23:00:47 UTC) #1
jln (very slow on Chromium)
https://codereview.chromium.org/12572005/diff/2001/third_party/tcmalloc/chromium/src/tcmalloc.cc File third_party/tcmalloc/chromium/src/tcmalloc.cc (right): https://codereview.chromium.org/12572005/diff/2001/third_party/tcmalloc/chromium/src/tcmalloc.cc#newcode1092 third_party/tcmalloc/chromium/src/tcmalloc.cc:1092: if (size <= kMaxSize && IsAllocSizePermitted(size)) { On 2013/03/15 ...
7 years, 9 months ago (2013-03-17 10:21:51 UTC) #2
gpike
I put an ASSERT at the bottom of do_malloc() that may help clarify the intent. ...
7 years, 9 months ago (2013-03-19 21:55:11 UTC) #3
jar (doing other things)
LGTM
7 years, 9 months ago (2013-03-19 21:59:57 UTC) #4
jln (very slow on Chromium)
lgtm
7 years, 9 months ago (2013-03-19 22:04:12 UTC) #5
gpike
Regarding that bytes-allocated counter: I ran 30 trials "with it" and 30 "without it" in ...
7 years, 9 months ago (2013-03-20 07:37:24 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gpike@chromium.org/12572005/7001
7 years, 9 months ago (2013-03-20 07:37:31 UTC) #7
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=21506
7 years, 9 months ago (2013-03-20 10:37:30 UTC) #8
jar (doing other things)
Thanks for checking it out!!! On 2013/03/20 07:37:24, gpike wrote: > Regarding that bytes-allocated counter: ...
7 years, 9 months ago (2013-03-20 16:04:16 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gpike@chromium.org/12572005/7001
7 years, 9 months ago (2013-03-20 16:26:56 UTC) #10
commit-bot: I haz the power
7 years, 9 months ago (2013-03-20 17:11:42 UTC) #11
Message was sent while issue was closed.
Change committed as 189321

Powered by Google App Engine
This is Rietveld 408576698