mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-19 12:38:19 +00:00
The existing speed checks time one call at one size, 128 bytes, with both operands aligned. A machine implementation usually takes its wide path only when the pointers satisfy some alignment condition, so that single point reports the best case and says nothing about the rest of the input space. Measure the same functions across a size sweep and every source and destination alignment pair instead, plus strlcpy. On rv64 the difference this exposes is not marginal: strcpy 32768 B s+0/d+0 2938.0 MB/s strcpy 32768 B s+1/d+1 2942.0 MB/s strcpy 32768 B s+1/d+2 626.0 MB/s memcmp 32768 B s+0/d+0 412.4 MB/s memcmp 32768 B s+1/d+2 41.0 MB/s Two pointers misaligned by the same amount run at the aligned rate; misaligned by different amounts they fall to a tenth of it. Neither number is visible from an aligned measurement alone. A function with no machine implementation reports the same rate at every alignment, so the sweep also shows which of them a machine directory actually covers. Each result reports MB/s, which compares across machines, and cycles per byte where perf_gettime() is reachable from an application, both from one timed loop. strcat starts from an empty destination on each turn, since appending to the last result would grow it without bound, so its figure includes that store. It sits behind TESTING_ARCH_LIBC_BENCH, default n, because a measurement runs for a fixed interval and a full sweep takes about a minute. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac> |
||
|---|---|---|
| .. | ||
| arch | ||
| cmocka | ||
| crypto | ||
| cxx | ||
| cxx-oot-build | ||
| drivers | ||
| enet | ||
| fff | ||
| fs | ||
| libc | ||
| ltp | ||
| mm | ||
| nettest | ||
| nuts | ||
| ostest | ||
| sched | ||
| sig_sp_test | ||
| testsuites | ||
| unity | ||
| .gitignore | ||
| CMakeLists.txt | ||
| Make.defs | ||
| Makefile | ||