mbox series

[v4,0/2] Optimization and benchmarking of bsearch()

Message ID 20240904160140.2743366-1-visitorckw@gmail.com
Headers show
Series Optimization and benchmarking of bsearch() | expand

Message

Kuan-Wei Chiu Sept. 4, 2024, 4:01 p.m. UTC
Hello,

I have added a benchmark test for the bsearch() function and optimized
its implementation to enhance its efficiency. Benchmark results on my
x86 machine demonstrate that the new implementation reduces execution
time by 15% compared to the previous version.

Changes in v4:
- Add three fields: "array-size," "key-pattern," and "contained" to
  benchmark json output.
- Update the benchmark result format in commit messages.

Changes in v3:
- Sort the stdlib-benchset entries in Makefile to resolve CI failures.

Changes in v2:
- Add benchmark tests for the bsearch() function.
- Update the commit message to reflect the new benchmark results.

Regards,
Kuan-Wei

Kuan-Wei Chiu (2):
  benchtests: Add benchmark test for bsearch
  Optimize bsearch() implementation for performance

 benchtests/Makefile        |   1 +
 benchtests/bench-bsearch.c | 114 +++++++++++++++++++++++++++++++++++++
 bits/stdlib-bsearch.h      |  20 +++----
 3 files changed, 124 insertions(+), 11 deletions(-)
 create mode 100644 benchtests/bench-bsearch.c