[PartitionAlloc] Use the thread cache in perftests.
On gLinux, this shows that with the thread cache, for tests that hit the cache: - PartitionAloc is ~2x faster with the thread cache on a *single* thread - The thread cache makes PartitionAlloc an order of magnitude faster at least with 4 threads (on a machine with 20 physical cores) - It is competitive with the System allocator (glibc) no matter the number of threads. See below: 1. One thread: [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/0 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_System_1_total= 49925308 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_System_1_total= 20 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_System_1_worst= 49925308 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_System_1_worst= 20 ns [ OK ] MemoryAllocationPerfTest.MultiBucketWithFree/0 (2039 ms) [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/1 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_1_total= 25700384 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_1_total= 38 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_1_worst= 25700384 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_1_worst= 38 ns [ OK ] MemoryAllocationPerfTest.MultiBucketWithFree/1 (2063 ms) [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/2 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_1_total= 47524712 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_1_total= 21 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_1_worst= 47524712 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_1_worst= 21 ns 2. 4 threads [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/9 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_System_4_total= 126134856 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_System_4_total= 7 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_System_4_worst= 28002580 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_System_4_worst= 35 ns [ OK ] MemoryAllocationPerfTest.MultiBucketWithFree/9 (2049 ms) [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/10 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_4_total= 2960527 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_4_total= 337 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_4_worst= 699706 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAlloc_4_worst= 1429 ns [ OK ] MemoryAllocationPerfTest.MultiBucketWithFree/10 (3352 ms) [ RUN ] MemoryAllocationPerfTest.MultiBucketWithFree/11 *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_4_total= 95663528 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_4_total= 10 ns *RESULT MemoryAllocationthroughput: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_4_worst= 21672892 runs/s *RESULT MemoryAllocationtime_per_allocation: MemoryAllocation.MultiBucketWithFree_PartitionAllocWithThreadCache_4_worst= 46 ns Bug: 998048 Change-Id: I13ac85714fae343871f0f448f0a36729e8ad4c20 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2491366 Commit-Queue: Benoit L <lizeb@chromium.org> Reviewed-by:Yuki Shiino <yukishiino@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#820265}
Showing
Please register or sign in to comment