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

Use ForAllEndpointsWithServerCluster instead of manual iteration. #12873

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

bzbarsky-apple
Copy link
Contributor

Manual iteration is O(N^2) in number of endpoints.

Problem

Manual looping is larger code and slower (O(N^2)) than using the helper we have. And we were notifying about the attributes twice.

Change overview

Use helper to loop over endpoints.

Testing

No behavior changes.

@github-actions
Copy link

PR #12873: Size comparison from 83aac59 to 6d88864

Decreases (1 build for telink)
platform target config section 83aac59 6d88864 change % change
telink lighting-app tlsr9518adk80d (read/write) 810978 810890 -88 -0.0
text 566032 565942 -90 -0.0
Full report (1 build for telink)
platform target config section 83aac59 6d88864 change % change
telink lighting-app tlsr9518adk80d (read/write) 810978 810890 -88 -0.0
bss 82864 82864 0 0.0
noinit 37160 37160 0 0.0
text 566032 565942 -90 -0.0

Manual iteration is O(N^2) in number of endpoints.
@github-actions
Copy link

github-actions bot commented Dec 10, 2021

PR #12873: Size comparison from 83aac59 to 38914f1

Increases (1 build for linux)
platform target config section 83aac59 38914f1 change % change
linux thermostat-no-ble arm64 (read only) 1947044 1947268 224 0.0
.text 1614096 1614320 224 0.0
Decreases (24 builds for efr32, esp32, k32w, mbed, nrfconnect, p6, qpg, telink)
platform target config section 83aac59 38914f1 change % change
efr32 lighting-app BRD4161A (read only) 809188 808756 -432 -0.1
.text 809180 808748 -432 -0.1
BRD4161A+rpc (read only) 796824 796376 -448 -0.1
.text 796816 796368 -448 -0.1
window-app BRD4161A (read only) 786164 785732 -432 -0.1
.text 786156 785724 -432 -0.1
esp32 all-clusters-app c3devkit (read only) 862812 862722 -90 -0.0
.flash.text 862812 862722 -90 -0.0
m5stack (read only) 966007 965975 -32 -0.0
.flash.text 960623 960591 -32 -0.0
k32w lighting-app k32w061+se05x+release (read/write) 669576 669480 -96 -0.0
.text 588012 587916 -96 -0.0
lock-app k32w061+debug (read/write) 619524 619444 -80 -0.0
.text 539848 539768 -80 -0.0
shell k32w061+debug (read/write) 624624 624528 -96 -0.0
.text 542740 542644 -96 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2324328 2324264 -64 -0.0
.text 1286904 1286840 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2308944 2308880 -64 -0.0
.text 1271544 1271480 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2282064 2282000 -64 -0.0
.text 1244664 1244600 -64 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 906795 906699 -96 -0.0
text 612912 612828 -84 -0.0
nrf52840dk_nrf52840+rpc (read/write) 869827 869747 -80 -0.0
text 587640 587556 -84 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 832794 832714 -80 -0.0
text 543340 543256 -84 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 879407 879327 -80 -0.0
text 592356 592272 -84 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 805666 805586 -80 -0.0
text 522876 522792 -84 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 884347 884267 -80 -0.0
text 595948 595864 -84 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 877587 877507 -80 -0.0
text 591144 591060 -84 -0.0
p6 all-clusters-app default (read/write) 2361904 2361472 -432 -0.0
.text 1320168 1319736 -432 -0.0
light-app default (read/write) 2294720 2294272 -448 -0.0
.text 1252984 1252536 -448 -0.0
lock-app default (read/write) 2270784 2270336 -448 -0.0
.text 1229048 1228600 -448 -0.0
qpg lighting-app qpg6100+debug (read only) 521328 521232 -96 -0.0
.text 516008 515912 -96 -0.0
lock-app qpg6100+debug (read only) 495696 495616 -80 -0.0
.text 490376 490296 -80 -0.0
telink lighting-app tlsr9518adk80d (read/write) 810978 810890 -88 -0.0
text 566032 565942 -90 -0.0
Full report (32 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section 83aac59 38914f1 change % change
efr32 lighting-app BRD4161A (read only) 809188 808756 -432 -0.1
(read/write) 123148 123148 0 0.0
.bss 121288 121288 0 0.0
.data 1860 1860 0 0.0
.text 809180 808748 -432 -0.1
BRD4161A+rpc (read only) 796824 796376 -448 -0.1
(read/write) 139824 139824 0 0.0
.bss 137864 137864 0 0.0
.data 1960 1960 0 0.0
.text 796816 796368 -448 -0.1
window-app BRD4161A (read only) 786164 785732 -432 -0.1
(read/write) 121280 121280 0 0.0
.bss 119456 119456 0 0.0
.data 1824 1824 0 0.0
.text 786156 785724 -432 -0.1
esp32 all-clusters-app c3devkit (read only) 862812 862722 -90 -0.0
(read/write) 1306058 1306058 0 0.0
.dram0.bss 65832 65832 0 0.0
.dram0.data 14124 14124 0 0.0
.flash.rodata 173064 173064 0 0.0
.flash.text 862812 862722 -90 -0.0
.iram0.text 62076 62076 0 0.0
m5stack (read only) 966007 965975 -32 -0.0
(read/write) 451744 451744 0 0.0
.dram0.bss 75128 75128 0 0.0
.dram0.data 34056 34056 0 0.0
.flash.rodata 210772 210772 0 0.0
.flash.text 960623 960591 -32 -0.0
.iram0.text 123451 123451 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 669576 669480 -96 -0.0
.bss 73872 73872 0 0.0
.data 1892 1892 0 0.0
.text 588012 587916 -96 -0.0
lock-app k32w061+debug (read/write) 619524 619444 -80 -0.0
.bss 72024 72024 0 0.0
.data 1852 1852 0 0.0
.text 539848 539768 -80 -0.0
shell k32w061+debug (read/write) 624624 624528 -96 -0.0
.bss 74252 74252 0 0.0
.data 1832 1832 0 0.0
.text 542740 542644 -96 -0.0
linux chip-tool-ipv6only arm64 (read only) 6864588 6864588 0 0.0
(read/write) 318785 318785 0 0.0
.bss 51985 51985 0 0.0
.data 1192 1192 0 0.0
.data.rel.ro 208776 208776 0 0.0
.dynamic 560 560 0 0.0
.got 53096 53096 0 0.0
.init 24 24 0 0.0
.init_array 176 176 0 0.0
.rodata 364700 364700 0 0.0
.text 5820228 5820228 0 0.0
thermostat-no-ble arm64 (read only) 1947044 1947268 224 0.0
(read/write) 137201 137201 0 0.0
.bss 59601 59601 0 0.0
.data 832 832 0 0.0
.data.rel.ro 70304 70304 0 0.0
.dynamic 560 560 0 0.0
.got 3592 3592 0 0.0
.init 24 24 0 0.0
.init_array 272 272 0 0.0
.rodata 125444 125444 0 0.0
.text 1614096 1614320 224 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2324328 2324264 -64 -0.0
.bss 185108 185108 0 0.0
.data 5240 5240 0 0.0
.heap 846096 846096 0 0.0
.text 1286904 1286840 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2308944 2308880 -64 -0.0
.bss 175824 175824 0 0.0
.data 5528 5528 0 0.0
.heap 855096 855096 0 0.0
.text 1271544 1271480 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2282064 2282000 -64 -0.0
.bss 174864 174864 0 0.0
.data 5520 5520 0 0.0
.heap 856064 856064 0 0.0
.text 1244664 1244600 -64 -0.0
pigweed-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 1140008 1140008 0 0.0
.bss 11756 11756 0 0.0
.data 4376 4376 0 0.0
.heap 1020312 1020312 0 0.0
.text 103392 103392 0 0.0
shell CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2053336 2053336 0 0.0
.bss 156900 156900 0 0.0
.data 4864 4864 0 0.0
.heap 874680 874680 0 0.0
.text 1015936 1015936 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 906795 906699 -96 -0.0
bss 116296 116296 0 0.0
rodata 101980 101980 0 0.0
text 612912 612828 -84 -0.0
nrf52840dk_nrf52840+rpc (read/write) 869827 869747 -80 -0.0
bss 112644 112644 0 0.0
rodata 93276 93276 0 0.0
text 587640 587556 -84 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 832794 832714 -80 -0.0
bss 117672 117672 0 0.0
rodata 97236 97236 0 0.0
text 543340 543256 -84 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 879407 879327 -80 -0.0
bss 113560 113560 0 0.0
rodata 98096 98096 0 0.0
text 592356 592272 -84 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 805666 805586 -80 -0.0
bss 114968 114968 0 0.0
rodata 93388 93388 0 0.0
text 522876 522792 -84 -0.0
pigweed-app nrf52840dk_nrf52840 (read/write) 497463 497463 0 0.0
bss 51820 51820 0 0.0
rodata 45852 45852 0 0.0
text 339492 339492 0 0.0
pump-app nrf52840dk_nrf52840 (read/write) 884347 884267 -80 -0.0
bss 113472 113472 0 0.0
rodata 99452 99452 0 0.0
text 595948 595864 -84 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 877587 877507 -80 -0.0
bss 113348 113348 0 0.0
rodata 97588 97588 0 0.0
text 591144 591060 -84 -0.0
shell nrf52840dk_nrf52840 (read/write) 781927 781927 0 0.0
bss 109544 109544 0 0.0
rodata 74276 74276 0 0.0
text 523588 523588 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 696974 696974 0 0.0
bss 110524 110524 0 0.0
rodata 68920 68920 0 0.0
text 444228 444228 0 0.0
p6 all-clusters-app default (read/write) 2361904 2361472 -432 -0.0
.bss 113244 113244 0 0.0
.data 2520 2520 0 0.0
.heap 917576 917576 0 0.0
.text 1320168 1319736 -432 -0.0
light-app default (read/write) 2294720 2294272 -448 -0.0
.bss 101016 101016 0 0.0
.data 2360 2360 0 0.0
.heap 929968 929968 0 0.0
.text 1252984 1252536 -448 -0.0
lock-app default (read/write) 2270784 2270336 -448 -0.0
.bss 99896 99896 0 0.0
.data 2328 2328 0 0.0
.heap 931120 931120 0 0.0
.text 1229048 1228600 -448 -0.0
qpg lighting-app qpg6100+debug (read only) 521328 521232 -96 -0.0
(read/write) 122336 122336 0 0.0
.bss 82712 82712 0 0.0
.data 992 992 0 0.0
.text 516008 515912 -96 -0.0
lock-app qpg6100+debug (read only) 495696 495616 -80 -0.0
(read/write) 122332 122332 0 0.0
.bss 81848 81848 0 0.0
.data 948 948 0 0.0
.text 490376 490296 -80 -0.0
persistent-storage-app qpg6100+debug (read only) 108104 108104 0 0.0
(read/write) 122336 122336 0 0.0
.bss 36160 36160 0 0.0
.data 288 288 0 0.0
.text 102784 102784 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 810978 810890 -88 -0.0
bss 82864 82864 0 0.0
noinit 37160 37160 0 0.0
text 566032 565942 -90 -0.0

@bzbarsky-apple bzbarsky-apple merged commit 4e442f7 into project-chip:master Dec 10, 2021
@bzbarsky-apple bzbarsky-apple deleted the use-better-loops branch December 10, 2021 16:04
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.

3 participants