tsan: optimize vector clock operations

Press ? to show keyboard shortcuts.
Committed
dvyukovMar 24 2014, 11:54 AM
Parents
rL204655: tsan: reorder SyncVar members to reduce contention
Branches
Unknown
Tags
Unknown
Description

tsan: optimize vector clock operations
Make vector clock operations O(1) for several important classes of use cases.
See comments for details.
Below are stats from a large server app, 77% of all clock operations are handled as O(1).

Clock acquire : 25983645

empty clock                     :          6288080
fast from release-store         :         14917504
contains my tid                 :          4515743
repeated (fast)                 :          2141428
full (slow)                     :          2636633
acquired something              :          1426863

Clock release : 2544216

resize                          :             6241
fast1                           :           197693
fast2                           :          1016293
fast3                           :             2007
full (slow)                     :          1797488
was acquired                    :           709227
clear tail                      :                1
last overflow                   :                0

Clock release store : 3446946

resize                          :           200516
fast                            :           469265
slow                            :          2977681
clear tail                      :                0

Clock acquire-release : 820028

rL204656

compiler-rt/trunk/lib/tsan/rtl/tsan_clock.cc

Loading...

compiler-rt/trunk/lib/tsan/rtl/tsan_clock.h

Loading...

compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc

Loading...

compiler-rt/trunk/lib/tsan/rtl/tsan_rtl_mutex.cc

Loading...

compiler-rt/trunk/lib/tsan/rtl/tsan_stat.cc

Loading...

compiler-rt/trunk/lib/tsan/rtl/tsan_stat.h

Loading...

compiler-rt/trunk/lib/tsan/tests/unit/tsan_clock_test.cc

Loading...

Add Comment