[PATCH] D88350: scudo: Re-order Allocator fields for improved performance. NFCI.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 19:10:11 PDT 2020


pcc created this revision.
pcc added a reviewer: cryptoad.
Herald added subscribers: Sanitizers, kristof.beyls.
Herald added a project: Sanitizers.
pcc requested review of this revision.

Move smaller and frequently-accessed fields near the beginning
of the data structure in order to improve locality and reduce
the number of instructions required to form an access to those
fields. With this change I measured a ~5% performance improvement on
BM_malloc_sql_trace_default on aarch64 Android devices (Pixel 4 and
DragonBoard 845c).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88350

Files:
  compiler-rt/lib/scudo/standalone/combined.h


Index: compiler-rt/lib/scudo/standalone/combined.h
===================================================================
--- compiler-rt/lib/scudo/standalone/combined.h
+++ compiler-rt/lib/scudo/standalone/combined.h
@@ -950,12 +950,6 @@
 
   static const uptr MaxTraceSize = 64;
 
-  GlobalStats Stats;
-  TSDRegistryT TSDRegistry;
-  PrimaryT Primary;
-  SecondaryT Secondary;
-  QuarantineT Quarantine;
-
   u32 Cookie;
 
   struct {
@@ -968,6 +962,12 @@
     u32 QuarantineMaxChunkSize; // quarantine_max_chunk_size
   } Options;
 
+  GlobalStats Stats;
+  PrimaryT Primary;
+  SecondaryT Secondary;
+  QuarantineT Quarantine;
+  TSDRegistryT TSDRegistry;
+
 #ifdef GWP_ASAN_HOOKS
   gwp_asan::GuardedPoolAllocator GuardedAlloc;
 #endif // GWP_ASAN_HOOKS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88350.294468.patch
Type: text/x-patch
Size: 757 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200926/4879abaa/attachment.bin>


More information about the llvm-commits mailing list