Skip to content

Commit

Permalink
Revert "[PartitionAlloc] Increase the thread cache limit to 1024 bytes."
Browse files Browse the repository at this point in the history
This reverts commit c6629fb.

Reason for revert: Deprecated in favor of a more holistic solution,
                   let's go back to the baseline to have better
                   comparisons.

Original change's description:
> [PartitionAlloc] Increase the thread cache limit to 1024 bytes.
>
> Renderers make a lot of large-ish allocations, which is not the case
> for the browser process. For instance, on Linux, running Speedometer
> 2.0, the current limit only allows us a 81% hit rate, vs 98% in the
> browser process. Increasing the limit to 1024 bytes halves the thread
> cache hit rate. See details in the linked bug.
>
> Bug: 1169157
> Change-Id: I5437d6a9bfe5a2ab7c24c876f6f92cf79f2109b2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2738979
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Commit-Queue: Benoit L <lizeb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#860531}

Bug: 1169157
Change-Id: I2277241e62eb9fae558f498bb5aaef954524814f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2748302
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#861629}
  • Loading branch information
Benoit L authored and Chromium LUCI CQ committed Mar 10, 2021
1 parent 4ae3999 commit 9f368dc
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions base/allocator/partition_allocator/thread_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,8 @@ class BASE_EXPORT ThreadCache {
static constexpr float kDefaultMultiplier = 2.;
static constexpr uint8_t kSmallBucketBaseCount = 64;

// TODO(crbug.com/1169157): Tune this further.
//
// From local experiments on Linux with Speedometer 2.0 (see
// crbug.com/1169157), renderers make a lot of allocations up to 1024
// bytes. The limit was previously set to 512, which is only good to serve
// ~81% of allocations in renderers, vs 98% in the browser process. Increasing
// this limit to 1024 catches 90% of allocations, that is halves forced misses
// vs 512. However, to get to 98%, it is necessary to set the limit at 8192,
// which is likely too high across all processes.
static constexpr size_t kSizeThreshold = 1024;
// TODO(lizeb): Optimize the threshold.
static constexpr size_t kSizeThreshold = 512;

private:
struct Bucket {
Expand Down

0 comments on commit 9f368dc

Please sign in to comment.