Commit cbf6da3
arolla::CancellationContext
This is a refactoring of the recently introduced `arolla::EvaluationContext::CancellationChecker`.
The key changes are as follows:
* The context stores the status after a computation has been canceled.
Motivation: This allows sharing the context between multiple aggregation accumulators, so that all of them can be cancelled at once.
* The rate-limiting logic has been implemented in the base class.
Motivation: The compiler can inline it => reduce the overhead.
Benchmarks:
name cpu/op
BM_CancellationContext_10ms_16 1.60ns ± 4%
BM_CancellationContext_10ms_4 2.48ns ± 2%
BM_CancellationContext_10ms_1 5.63ns ± 1%
BM_CancellationContext_10ms_0 11.4ns ± 1%
PiperOrigin-RevId: 720239473
Change-Id: I05acded6eeb45cf19c7eed3f151487351f010f591 parent 4c1d413 commit cbf6da3
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
0 commit comments