[PATCH] D71104: scudo: Add a basic malloc/free benchmark.

Mitch Phillips via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 07:53:22 PST 2019


hctim added inline comments.


================
Comment at: compiler-rt/lib/scudo/standalone/benchmarks/malloc_benchmark.cpp:33
+    auto *Data = reinterpret_cast<uint8_t *>(Ptr);
+    for (size_t I = 0; I < NBytes; I += PageSize)
+      Data[I] = 1;
----------------
hctim wrote:
> Can we instead do what bionic-benchmarks does on their malloc test, and touch each page to ensure residency (although we're only allocating 8-bytes at a time).
> 
> Similarly, they also bulk allocate -> bulk deallocate using a storage vector. Seems like a better solution - so we don't just hit the freelist `128 * 1024` times.
I have absolutely no idea why I read this loop as memcpy, but please ignore the first point.

Bulk allocate/delete would still be great.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71104/new/

https://reviews.llvm.org/D71104





More information about the llvm-commits mailing list