Skip to content

Commit

Permalink
Detect the presence of [[likely]] properly (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuanqiXu9 committed Jun 22, 2022
1 parent 042e58a commit 0d2ffaf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions async_simple/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

#include <stdexcept>

#if defined(__clang__) && __clang_major__ < 12
#define LIKELY
#define UNLIKELY
#else
#if __has_cpp_attribute(likely) && __has_cpp_attribute(unlikely)
#define LIKELY [[likely]]
#define UNLIKELY [[unlikely]]
#else
#define LIKELY
#define UNLIKELY
#endif

#ifdef _WIN32
Expand Down

1 comment on commit 0d2ffaf

@github-actions
Copy link

Choose a reason for hiding this comment

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

C++ Benchmark

Benchmark suite Current: 0d2ffaf Previous: 042e58a Ratio
Future_chain 21903.47140006139 ns/iter 24214.657715694822 ns/iter 0.90
Future_collectAll 12764380.035714546 ns/iter 12202803.635135163 ns/iter 1.05
async_simple_Lazy_chain 20896.922464312345 ns/iter 23840.776564254684 ns/iter 0.88
async_simple_Lazy_collectAll 12068032.727272669 ns/iter 12190501.655172268 ns/iter 0.99
RescheduleLazy_chain 46289.67859949707 ns/iter 52222.67296774075 ns/iter 0.89
RescheduleLazy_collectAll 20826176.972999975 ns/iter 23353040.804000005 ns/iter 0.89
Uthread_switch 103381196.42856976 ns/iter 104520849.71428478 ns/iter 0.99
Uthread_async 103390439.57142329 ns/iter 103918254.5714295 ns/iter 0.99
Uthread_await 103952307.85714409 ns/iter 103949440.85714185 ns/iter 1.00
Uthread_collectAll 11657231.66666701 ns/iter 11765372.029850766 ns/iter 0.99
ThreadPool_noWorkSteal 909958501.5000002 ns/iter 804993636.0000061 ns/iter 1.13
ThreadPool_withWorkSteal 76890336.2142867 ns/iter 77616488.46153854 ns/iter 0.99

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

Please sign in to comment.