mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
b8dc48ab18
Removed as much branching (if statements) from the gpio_intr_service ISR, as possible and split the while loop into two. Also forced writing the two status*_w1tc variables only once, instead of every time after calling the external function hooks. The measurements below, was done using the following tools: Toolchain version: crosstool-ng-1.22.0-80-g6c4433a Compiler version: 5.2.0 Here follows a comparison of the gpio_intr_service ISR's execution time, using a DS1054 oscilloscope. All the time spent calling external functions, via the function pointers gpio_isr_func[gpio_num].fn, were disregarded. With OPTIMIZATION_FLAGS = -Og, 1.34 uSeconds faster: 3.22 uSec (with this patch) 4.56 uSec (with commit 71c90ac4) 100 - (100 * 4.56 / 3.22) = 42% faster With OPTIMIZATION_FLAGS = -Os, 1.65 uSeconds faster: 2.89 uSec (with this patch) 4.54 uSec (with commit 71c90ac4) 100 - (100 * 4.54 / 2.89) = 57% faster Signed-off-by: Konstantin Kondrashov <konstantin@espressif.com> Merges https://github.com/espressif/esp-idf/pull/2861