Skip to content

Commit

Permalink
use _mm_pause instead of __builtin_ia_32_pause when __INTEL_COMPILER …
Browse files Browse the repository at this point in the history
…defined (#1885)
  • Loading branch information
gabswb authored Dec 22, 2022
1 parent 9dd19a2 commit 8866c10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#elif defined(__i386__) || defined(__x86_64__)
# if defined(__clang__)
# include <emmintrin.h>
# elif defined(__INTEL_COMPILER)
# include <immintrin.h>
# endif
#endif

Expand Down Expand Up @@ -65,7 +67,7 @@ class SpinLockMutex
#if defined(_MSC_VER)
YieldProcessor();
#elif defined(__i386__) || defined(__x86_64__)
# if defined(__clang__)
# if defined(__clang__) || defined(__INTEL_COMPILER)
_mm_pause();
# else
__builtin_ia32_pause();
Expand Down
2 changes: 1 addition & 1 deletion api/test/common/spinlock_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s)
#if defined(_MSC_VER)
YieldProcessor();
#elif defined(__i386__) || defined(__x86_64__)
# if defined(__clang__)
# if defined(__clang__) || defined(__INTEL_COMPILER)
_mm_pause();
# else
__builtin_ia32_pause();
Expand Down

1 comment on commit 8866c10

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 8866c10 Previous: 9dd19a2 Ratio
BM_BaselineBuffer/1 8239793.77746582 ns/iter 489762.9041477566 ns/iter 16.82
BM_BaselineBuffer/2 7172578.811645508 ns/iter 3322465.419769287 ns/iter 2.16

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.