[libc-commits] [PATCH] D72516: [llvm-libc] Add memory function benchmarks
Guillaume Chatelet via Phabricator via libc-commits
libc-commits at lists.llvm.org
Fri Jan 10 08:58:55 PST 2020
gchatelet created this revision.
gchatelet added reviewers: sivachandra, ckennelly.
Herald added subscribers: libc-commits, MaskRay, mgorny.
Herald added a project: libc-project.
This patch adds a benchmarking infrastructure for llvm-libc memory functions.
In a nutshell, the code can benchmark small and large buffers for the memcpy, memset and memcmp functions.
It also produces graphs of size vs latency by running targets of the form `render-libc-{memcpy|memset|memcmp}-benchmark-{small|big}`.
The configurations are provided as JSON files and the benchmark also produces a JSON file.
This file is then parsed and rendered as a PNG file via the `render.py` script (make sure to run `pip3 install matplotlib scipy numpy`).
The script can take several JSON files as input and will superimpose the curves if they are from the same host.
TODO:
- The code benchmarks whatever is available on the host but should be configured to benchmark the -to be added- llvm-libc memory functions.
- Add a README file with instructions and rationale.
- Produce scores to track the performance of the functions over time to allow for regression detection.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72516
Files:
libc/cmake/modules/LLVMLibCRules.cmake
libc/utils/CMakeLists.txt
libc/utils/HdrGen/CMakeLists.txt
libc/utils/benchmarks/CMakeLists.txt
libc/utils/benchmarks/configuration_big.json
libc/utils/benchmarks/configuration_small.json
libc/utils/benchmarks/json.cc
libc/utils/benchmarks/json.h
libc/utils/benchmarks/json_test.cc
libc/utils/benchmarks/libc_benchmark.cc
libc/utils/benchmarks/libc_benchmark.h
libc/utils/benchmarks/libc_benchmark_test.cc
libc/utils/benchmarks/libc_memory_benchmark.cc
libc/utils/benchmarks/libc_memory_benchmark.h
libc/utils/benchmarks/libc_memory_benchmark_main.cc
libc/utils/benchmarks/libc_memory_benchmark_main.h
libc/utils/benchmarks/libc_memory_benchmark_test.cc
libc/utils/benchmarks/memcmp.cc
libc/utils/benchmarks/memcpy.cc
libc/utils/benchmarks/memset.cc
libc/utils/benchmarks/render.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72516.237349.patch
Type: text/x-patch
Size: 78244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20200110/6309d197/attachment-0001.bin>
More information about the libc-commits
mailing list