Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1af13c81 authored by Edgar Arriaga's avatar Edgar Arriaga
Browse files

Optimization for isZero to reduce processor instructions

Results showed an improvement of ~0.58% of app cpu-cycles that happen
mostly within RenderNodeDrawable::onDraw hits this path every frame during view
drawing traversal. At the assembly code level, the fabsf fuction is
instrinsic and replaced by a single instruction which is the reason this
code is more optimal.

Did further benchmarking with a binary that contained a for loop
iterating on calling this function and the cpu-cycle results obtained are:

Overhead  Shared Object                                   Symbol
16.87%    /data/local/tmp/edgartest                       isZeroOld(float)
9.66%     /data/local/tmp/edgartest                       isZeroNew(float)

where isZeroNew is the proposed function, and we can see it is ~40% faster
than the old method.

Test: Ran hwuimacro benchmarks and also did some benchmarking with my
own binary

Change-Id: I68b7db1bf501a3faa669ad5b7d3807ad9cb8798e
parent 5a6a5740
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment