Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Resource arithmetic concerning += and -= operators needs to be improved such that the impact of shared resources is minimal. Following is the observation of Resources_BENCHMARK_Test.Arithmetic.
Head
====
Resources benchmark on top of 6ce156b2bed7edecb27ce50f68d262ea4ab4f88e
[ RUN ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 Took 72228us to perform 50000 'total += r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 101574us to perform 50000 'total -= r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 251715us to perform 50000 'total = total + r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 293414us to perform 50000 'total = total - r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256
Pre-shared resources
=================
Resources benchmark on top of 48a492cd9d7d0a194735b9b4107a35b489c596e1
[ RUN ] ResourcesOperators/Resources_BENCHMARK_Test.Arithmetic/0 Took 48583us to perform 50000 'total += r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 86166us to perform 50000 'total -= r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 233148us to perform 50000 'total = total + r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256 Took 265719us to perform 50000 'total = total - r' operations on cpus(*):1; gpus(*):1; mem(*):128; disk(*):256
'total += r' run time sees 40% jump. (I've run these 10 times and took an average, the avg is 48685.4us (pre-shared resources) vs. 68421.7us (post-shared resources).