SpinLockMutex small cleanup; improved and extended benchmark
Fixes # (issue)
Changes
load()not required intry_lock()- shortened loop in
lock() - fixed erroneous yield() in
BM_ThreadYieldSpinLockThrashing - added
std::mutexto benchmark - removed superfluous
staticas code is already in unnamed namespace
It seems that at least on Apple M1 (lClang+libc) the std::mutex outperforms SpinlockMutex with higher number of threads.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: dbarker / name: Doug Barker (b994d0d7f41487c1b9b97543dd3a8b31b1b8a83f)
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 89.91%. Comparing base (907277c) to head (b994d0d).
Additional details and impacted files
@@ Coverage Diff @@
## main #3706 +/- ##
==========================================
- Coverage 89.91% 89.91% -0.00%
==========================================
Files 225 225
Lines 7134 7132 -2
==========================================
- Hits 6414 6412 -2
Misses 720 720
| Files with missing lines | Coverage Δ | |
|---|---|---|
| api/include/opentelemetry/common/spin_lock_mutex.h | 100.00% <100.00%> (ø) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
I'm confused why this CI/Format check fails! Any hint is welcome
@Reneg973
Tip to format all the code (C++, CMake, Bazel):
[malff@malff-desktop ~]$ more ~/bin/otel_cf.sh
#!/bin/bash
podman run --rm --privileged=true --volume ${PWD}:/otel otel/cpp_format_tools
See https://github.com/open-telemetry/cpp-build-tools/tree/main/cpp_format_tools