[PATCH] D64082: [MemFunctions] Add microbenchmarks for memory functions.

Clement Courbet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 05:15:56 PDT 2019


courbet marked an inline comment as done.
courbet added inline comments.


================
Comment at: MicroBenchmarks/MemFunctions/main.cpp:29
+void BM_MemCmp(benchmark::State& state) {
+  constexpr const size_t kNumElements = 4096 / kSize;
+
----------------
lebedev.ri wrote:
> Magical constant
> I'm guessing that by `4096` you limit the maximal size of `p` and `q` buffers,
> implying that they should fit into L1 cache?
> Do you want to use the actual L1 size instead?
> Otherwise, 
> ```
> static constexpr size_t kMaxBufSizeBytes = 4096;
> constexpr size_t kNumElements = kMaxBufSizeBytes / kSize;
> ```
It's combination of things, among which caching. But you're right that this warrants a comment. Done.


Repository:
  rT test-suite

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

https://reviews.llvm.org/D64082





More information about the llvm-commits mailing list