diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-16 01:59:07 -0500 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-17 14:34:36 +0200 |
commit | afbc57927854c423e12206c048bbe7c285a4d9a6 (patch) | |
tree | 573922dd4b17a414e4ef0ebba4a53d257a153118 /xmlhelp/Library_ucpchelp1.mk | |
parent | 581aa2ae225c0d61f65025a5b0155820818e89e0 (diff) |
add osl_atomic_* api to allow for inlined atomic increment/decrement
atomic increment/decrement is provided by
osl_increment/decrementInterlockedCount()
but that is a exported dll function, so it cannot be inlined.
valgrind analysis of a run, loading a medium sized spreadsheet, shows
that these 2 functions were called 3.5 millions times for a total cost of
55 millions of instructions... a cost of 8 instructions per call,
which is at least a 300% overhead since an atomic inc/dec is 2 instructions
iow we could save about 1% of the total instruction count of that run(4.6B)
We cannot change the existing api, as this would break ABI.
but we can add a new api. and migrate internal user to it.
osl_atomic_decrement/osl_atomic_increment do the same task,
than osl_*IntelockedCount() but do that inlined if possible.
Note that this version only optimize the case GCC with atomic built-in.
but support for other case should not be very hard.
follows-up patches will replace the use of the osl_*InterlockedCount()
in the product with their osl_atomic_* equivalent.
Change-Id: If4dcbf94ea6f62eb6d55d30613fe65878ffb8023
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'xmlhelp/Library_ucpchelp1.mk')
0 files changed, 0 insertions, 0 deletions