Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] Use nvs iterator to check if key exists #16885

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

shubhamdp
Copy link
Contributor

Problem

  • Current ESP32Config::ConfigValueExists() API takes a brute force approach with all the supported data types to find whether a key is present in NVS or not.

Change overview

  • Use the nvs_iterator to check if key is present in nvs or not

Testing

  • Manually tested the results of an old API and new API.

@github-actions
Copy link

github-actions bot commented Mar 31, 2022

PR #16885: Size comparison from a86ad03 to 0665676

Increases (2 builds for esp32)
platform target config section a86ad03 0665676 change % change
esp32 all-clusters-app c3devkit (read only) 970616 970882 266 0.0
(read/write) 1395138 1395242 104 0.0
.flash.rodata 199544 199648 104 0.1
.flash.text 970616 970882 266 0.0
m5stack (read only) 1026335 1026523 188 0.0
(read/write) 462900 462988 88 0.0
.flash.rodata 229056 229144 88 0.0
.flash.text 1020951 1021139 188 0.0
Full report (31 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
platform target config section a86ad03 0665676 change % change
cc13x2_26x2 lock-ftd LP_CC2652R7 (read only) 667707 667707 0 0.0
(read/write) 184036 184036 0 0.0
.bss 81784 81784 0 0.0
.data 3132 3132 0 0.0
.rodata 79627 79627 0 0.0
.text 587600 587600 0 0.0
lock-mtd LP_CC2652R7 (read only) 616835 616835 0 0.0
(read/write) 154500 154500 0 0.0
.bss 77512 77512 0 0.0
.data 3132 3132 0 0.0
.rodata 79507 79507 0 0.0
.text 536840 536840 0 0.0
pump-app LP_CC2652R7 (read only) 687159 687159 0 0.0
(read/write) 165744 165744 0 0.0
.bss 82176 82176 0 0.0
.data 3164 3164 0 0.0
.rodata 81703 81703 0 0.0
.text 604972 604972 0 0.0
pump-controller-app LP_CC2652R7 (read only) 669415 669415 0 0.0
(read/write) 183232 183232 0 0.0
.bss 81920 81920 0 0.0
.data 3128 3128 0 0.0
.rodata 78039 78039 0 0.0
.text 590892 590892 0 0.0
cyw30739 light cyw930739m2evb_01 (read/write) 609754 609754 0 0.0
.app_xip_area 516496 516496 0 0.0
.bss 76004 76004 0 0.0
.data 600 600 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
lock cyw930739m2evb_01 (read/write) 567266 567266 0 0.0
.app_xip_area 475544 475544 0 0.0
.bss 74508 74508 0 0.0
.data 564 564 0 0.0
.rodata 0 0 0 0.0
.text 0 0 0 0.0
ota-requestor-no-progress-logging cyw930739m2evb_01 (read/write) 579182 579182 0 0.0
.app_xip_area 477804 477804 0 0.0
.bss 83836 83836 0 0.0
.data 504 504 0 0.0
.rodata 0 0 0 0.0
.text 112 112 0 0.0
efr32 lighting-app BRD4161A (read only) 930484 930484 0 0.0
(read/write) 129128 129128 0 0.0
.bss 127136 127136 0 0.0
.data 1992 1992 0 0.0
.text 930476 930476 0 0.0
BRD4161A+rpc (read only) 959492 959492 0 0.0
(read/write) 145084 145084 0 0.0
.bss 142912 142912 0 0.0
.data 2172 2172 0 0.0
.text 959484 959484 0 0.0
window-app BRD4161A (read only) 859960 859960 0 0.0
(read/write) 127096 127096 0 0.0
.bss 125224 125224 0 0.0
.data 1868 1868 0 0.0
.text 859952 859952 0 0.0
esp32 all-clusters-app c3devkit (read only) 970616 970882 266 0.0
(read/write) 1395138 1395242 104 0.0
.dram0.bss 62456 62456 0 0.0
.dram0.data 14220 14220 0 0.0
.flash.rodata 199544 199648 104 0.1
.flash.text 970616 970882 266 0.0
.iram0.text 62016 62016 0 0.0
m5stack (read only) 1026335 1026523 188 0.0
(read/write) 462900 462988 88 0.0
.dram0.bss 67984 67984 0 0.0
.dram0.data 34024 34024 0 0.0
.flash.rodata 229056 229144 88 0.0
.flash.text 1020951 1021139 188 0.0
.iram0.text 123107 123107 0 0.0
k32w light k32w061+release (read/write) 707492 707492 0 0.0
.bss 77992 77992 0 0.0
.data 1872 1872 0 0.0
.text 621828 621828 0 0.0
lock k32w061+release (read/write) 706600 706600 0 0.0
.bss 77960 77960 0 0.0
.data 1912 1912 0 0.0
.text 620928 620928 0 0.0
linux all-clusters-app debug (read only) 2553105 2553105 0 0.0
(read/write) 143872 143872 0 0.0
.bss 57472 57472 0 0.0
.data 1296 1296 0 0.0
.data.rel.ro 79352 79352 0 0.0
.dynamic 592 592 0 0.0
.got 4184 4184 0 0.0
.init 27 27 0 0.0
.init_array 952 952 0 0.0
.rodata 219077 219077 0 0.0
.text 2169602 2169602 0 0.0
bridge-app debug+rpc (read only) 1783005 1783005 0 0.0
(read/write) 89880 89880 0 0.0
.bss 44552 44552 0 0.0
.data 2000 2000 0 0.0
.data.rel.ro 38232 38232 0 0.0
.dynamic 592 592 0 0.0
.got 3928 3928 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 147057 147057 0 0.0
.text 1520085 1520085 0 0.0
chip-tool debug (read only) 10333325 10333325 0 0.0
(read/write) 356640 356640 0 0.0
.bss 22080 22080 0 0.0
.data 1072 1072 0 0.0
.data.rel.ro 327264 327264 0 0.0
.dynamic 624 624 0 0.0
.got 4896 4896 0 0.0
.init 27 27 0 0.0
.init_array 664 664 0 0.0
.rodata 529997 529997 0 0.0
.text 9015269 9015269 0 0.0
chip-tool-no-interactive-ipv6only arm64 (read only) 9941780 9941780 0 0.0
(read/write) 475633 475633 0 0.0
.bss 40401 40401 0 0.0
.data 1136 1136 0 0.0
.data.rel.ro 374024 374024 0 0.0
.dynamic 560 560 0 0.0
.got 56264 56264 0 0.0
.init 24 24 0 0.0
.init_array 192 192 0 0.0
.rodata 503788 503788 0 0.0
.text 8379380 8379380 0 0.0
door-lock-app debug (read only) 2035729 2035729 0 0.0
(read/write) 117288 117288 0 0.0
.bss 47680 47680 0 0.0
.data 1008 1008 0 0.0
.data.rel.ro 63176 63176 0 0.0
.dynamic 592 592 0 0.0
.got 4128 4128 0 0.0
.init 27 27 0 0.0
.init_array 672 672 0 0.0
.rodata 183649 183649 0 0.0
.text 1701762 1701762 0 0.0
lighting-app debug+rpc (read only) 2213489 2213489 0 0.0
(read/write) 124280 124280 0 0.0
.bss 48960 48960 0 0.0
.data 1488 1488 0 0.0
.data.rel.ro 68248 68248 0 0.0
.dynamic 608 608 0 0.0
.got 4176 4176 0 0.0
.init 27 27 0 0.0
.init_array 752 752 0 0.0
.rodata 177665 177665 0 0.0
.text 1876146 1876146 0 0.0
ota-provider-app debug (read only) 1975553 1975553 0 0.0
(read/write) 113016 113016 0 0.0
.bss 47584 47584 0 0.0
.data 1288 1288 0 0.0
.data.rel.ro 58488 58488 0 0.0
.dynamic 608 608 0 0.0
.got 4384 4384 0 0.0
.init 27 27 0 0.0
.init_array 624 624 0 0.0
.rodata 169291 169291 0 0.0
.text 1653890 1653890 0 0.0
ota-requestor-app debug (read only) 2003425 2003425 0 0.0
(read/write) 116208 116208 0 0.0
.bss 48544 48544 0 0.0
.data 1480 1480 0 0.0
.data.rel.ro 60696 60696 0 0.0
.dynamic 592 592 0 0.0
.got 4192 4192 0 0.0
.init 27 27 0 0.0
.init_array 648 648 0 0.0
.rodata 165652 165652 0 0.0
.text 1684418 1684418 0 0.0
shell debug (read only) 2468457 2468457 0 0.0
(read/write) 147824 147824 0 0.0
.bss 67304 67304 0 0.0
.data 784 784 0 0.0
.data.rel.ro 74016 74016 0 0.0
.dynamic 592 592 0 0.0
.got 4160 4160 0 0.0
.init 27 27 0 0.0
.init_array 928 928 0 0.0
.rodata 212274 212274 0 0.0
.text 2098562 2098562 0 0.0
thermostat-no-ble arm64 (read only) 2293076 2293076 0 0.0
(read/write) 148657 148657 0 0.0
.bss 62849 62849 0 0.0
.data 1040 1040 0 0.0
.data.rel.ro 77216 77216 0 0.0
.dynamic 560 560 0 0.0
.got 4544 4544 0 0.0
.init 24 24 0 0.0
.init_array 360 360 0 0.0
.rodata 142052 142052 0 0.0
.text 1927056 1927056 0 0.0
tv-app debug (read only) 2714617 2714617 0 0.0
(read/write) 248184 248184 0 0.0
.bss 164624 164624 0 0.0
.data 3136 3136 0 0.0
.data.rel.ro 74368 74368 0 0.0
.dynamic 592 592 0 0.0
.got 4552 4552 0 0.0
.init 27 27 0 0.0
.init_array 896 896 0 0.0
.rodata 208811 208811 0 0.0
.text 2330674 2330674 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2358540 2358540 0 0.0
.bss 185052 185052 0 0.0
.data 5760 5760 0 0.0
.text 1321140 1321140 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 (read/write) 1148079 1148079 0 0.0
bss 143092 143092 0 0.0
rodata 143232 143232 0 0.0
text 786952 786952 0 0.0
p6 all-clusters-app default (read/write) 2502984 2502984 0 0.0
.bss 118488 118488 0 0.0
.data 2640 2640 0 0.0
.text 1461248 1461248 0 0.0
light-app default (read/write) 2404472 2404472 0 0.0
.bss 111944 111944 0 0.0
.data 2496 2496 0 0.0
.text 1362736 1362736 0 0.0
lock-app default (read/write) 2368080 2368080 0 0.0
.bss 111688 111688 0 0.0
.data 2456 2456 0 0.0
.text 1326344 1326344 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 791428 791428 0 0.0
bss 70296 70296 0 0.0
noinit 40416 40416 0 0.0
text 561386 561386 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit 5c2f1d0 into project-chip:master Apr 1, 2022
@shubhamdp shubhamdp deleted the esp32_nvs_iterator branch April 1, 2022 05:50
chencheung pushed a commit to chencheung/connectedhomeip that referenced this pull request Apr 6, 2022
* [ESP32] Use nvs iterator to check if key exists

* Comment explaining why no need to release iterator in NULL case
chencheung pushed a commit to chencheung/connectedhomeip that referenced this pull request Apr 6, 2022
* [ESP32] Use nvs iterator to check if key exists

* Comment explaining why no need to release iterator in NULL case
andrei-menzopol pushed a commit to andrei-menzopol/connectedhomeip that referenced this pull request Apr 14, 2022
* [ESP32] Use nvs iterator to check if key exists

* Comment explaining why no need to release iterator in NULL case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants