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

Introduce a way to loop over endpoints that have a given server cluster. #12542

Merged

Conversation

bzbarsky-apple
Copy link
Contributor

We have several places that are doing this, all of them in
not-so-great ways (e.g. mapping indices to endpoint ids and then back
to indices, which is O(N^2) in number of endpoints). Better to have a
utility that does it right.

Problem

See above.

Change overview

See above.

Testing

No behavior changes, except smaller, faster code.

We have several places that are doing this, all of them in
not-so-great ways (e.g. mapping indices to endpoint ids and then back
to indices, which is O(N^2) in number of endpoints).  Better to have a
utility that does it right.
@todo
Copy link

todo bot commented Dec 3, 2021

Log SoftwareFault event and walk them all.

// TODO: Log SoftwareFault event and walk them all.
return Loop::Break;
});
}
};


This comment was generated by todo based on a TODO comment in 12b3906 in #12542. cc @bzbarsky-apple.

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

PR #12542: Size comparison from f111727 to 12b3906

Increases (4 builds for linux)
platform target config section f111727 12b3906 change % change
linux all-clusters-app debug (read only) 1848081 1848097 16 0.0
.text 1556690 1556706 16 0.0
bridge-app debug+rpc (read only) 1426261 1426293 32 0.0
.text 1200709 1200741 32 0.0
lighting-app debug+rpc (read only) 1710801 1710833 32 0.0
.text 1427410 1427442 32 0.0
tv-app debug (read only) 2020441 2020473 32 0.0
.text 1692354 1692386 32 0.0
Decreases (25 builds for efr32, esp32, k32w, mbed, nrfconnect, p6, qpg, telink)
platform target config section f111727 12b3906 change % change
efr32 lighting-app BRD4161A (read only) 751536 751232 -304 -0.0
.text 751528 751224 -304 -0.0
BRD4161A+rpc (read only) 780216 779912 -304 -0.0
.text 780208 779904 -304 -0.0
lock-app BRD4161A (read only) 725392 725088 -304 -0.0
.text 725384 725080 -304 -0.0
window-app BRD4161A (read only) 728704 728400 -304 -0.0
.text 728696 728392 -304 -0.0
esp32 all-clusters-app c3devkit (read only) 847818 847686 -132 -0.0
.flash.text 847818 847686 -132 -0.0
m5stack (read only) 918227 918147 -80 -0.0
.flash.text 912843 912763 -80 -0.0
k32w lighting-app k32w061+se05x+release (read/write) 728716 728652 -64 -0.0
.text 641744 641680 -64 -0.0
lock-app k32w061+debug (read/write) 617700 617636 -64 -0.0
.text 540324 540260 -64 -0.0
shell k32w061+debug (read/write) 683608 683528 -80 -0.0
.text 594612 594532 -80 -0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read/write) 2309224 2309160 -64 -0.0
.text 1271800 1271736 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read/write) 2295616 2295552 -64 -0.0
.text 1258216 1258152 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read/write) 2268648 2268584 -64 -0.0
.text 1231248 1231184 -64 -0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 891475 891395 -80 -0.0
text 602740 602668 -72 -0.0
nrf52840dk_nrf52840+rpc (read/write) 854851 854771 -80 -0.0
text 577736 577664 -72 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 817370 817306 -64 -0.0
text 533076 533008 -68 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 862331 862251 -80 -0.0
text 580992 580920 -72 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 788486 788406 -80 -0.0
text 511420 511352 -68 -0.0
pump-app nrf52840dk_nrf52840 (read/write) 868347 868267 -80 -0.0
text 585056 584988 -68 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 861411 861347 -64 -0.0
text 580116 580048 -68 -0.0
p6 all-clusters-app default (read/write) 2339504 2339216 -288 -0.0
.text 1297768 1297480 -288 -0.0
light-app default (read/write) 2278856 2278568 -288 -0.0
.text 1237120 1236832 -288 -0.0
lock-app default (read/write) 2254208 2253904 -304 -0.0
.text 1212472 1212168 -304 -0.0
qpg lighting-app qpg6100+debug (read only) 510500 510436 -64 -0.0
.text 505180 505116 -64 -0.0
lock-app qpg6100+debug (read only) 483308 483244 -64 -0.0
.text 477988 477924 -64 -0.0
telink lighting-app tlsr9518adk80d (read/write) 794566 794438 -128 -0.0
text 554526 554394 -132 -0.0
Full report (39 builds for efr32, esp32, k32w, linux, mbed, nrfconnect, p6, qpg, telink)
platform target config section f111727 12b3906 change % change
efr32 lighting-app BRD4161A (read only) 751536 751232 -304 -0.0
(read/write) 120032 120032 0 0.0
.bss 118200 118200 0 0.0
.data 1828 1828 0 0.0
.text 751528 751224 -304 -0.0
BRD4161A+rpc (read only) 780216 779912 -304 -0.0
(read/write) 138336 138336 0 0.0
.bss 136400 136400 0 0.0
.data 1936 1936 0 0.0
.text 780208 779904 -304 -0.0
lock-app BRD4161A (read only) 725392 725088 -304 -0.0
(read/write) 117736 117736 0 0.0
.bss 115952 115952 0 0.0
.data 1784 1784 0 0.0
.text 725384 725080 -304 -0.0
window-app BRD4161A (read only) 728704 728400 -304 -0.0
(read/write) 118168 118168 0 0.0
.bss 116376 116376 0 0.0
.data 1792 1792 0 0.0
.text 728696 728392 -304 -0.0
esp32 all-clusters-app c3devkit (read only) 847818 847686 -132 -0.0
(read/write) 1223842 1223842 0 0.0
.dram0.bss 56576 56576 0 0.0
.dram0.data 14052 14052 0 0.0
.flash.rodata 167760 167760 0 0.0
.flash.text 847818 847686 -132 -0.0
.iram0.text 61394 61394 0 0.0
m5stack (read only) 918227 918147 -80 -0.0
(read/write) 422820 422820 0 0.0
.dram0.bss 61960 61960 0 0.0
.dram0.data 34016 34016 0 0.0
.flash.rodata 195564 195564 0 0.0
.flash.text 912843 912763 -80 -0.0
.iram0.text 122943 122943 0 0.0
k32w lighting-app k32w061+se05x+release (read/write) 728716 728652 -64 -0.0
.bss 79312 79312 0 0.0
.data 1860 1860 0 0.0
.text 641744 641680 -64 -0.0
lock-app k32w061+debug (read/write) 617700 617636 -64 -0.0
.bss 69752 69752 0 0.0
.data 1824 1824 0 0.0
.text 540324 540260 -64 -0.0
shell k32w061+debug (read/write) 683608 683528 -80 -0.0
.bss 81400 81400 0 0.0
.data 1796 1796 0 0.0
.text 594612 594532 -80 -0.0
linux all-clusters-app debug (read only) 1848081 1848097 16 0.0
(read/write) 124520 124520 0 0.0
.bss 50896 50896 0 0.0
.data 1120 1120 0 0.0
.data.rel.ro 67088 67088 0 0.0
.dynamic 592 592 0 0.0
.got 4120 4120 0 0.0
.init 27 27 0 0.0
.init_array 688 688 0 0.0
.rodata 148501 148501 0 0.0
.text 1556690 1556706 16 0.0
bridge-app debug+rpc (read only) 1426261 1426293 32 0.0
(read/write) 74616 74616 0 0.0
.bss 36240 36240 0 0.0
.data 1728 1728 0 0.0
.data.rel.ro 31560 31560 0 0.0
.dynamic 592 592 0 0.0
.got 3992 3992 0 0.0
.init 27 27 0 0.0
.init_array 480 480 0 0.0
.rodata 120652 120652 0 0.0
.text 1200709 1200741 32 0.0
chip-tool debug (read only) 6622533 6622533 0 0.0
(read/write) 202376 202376 0 0.0
.bss 34504 34504 0 0.0
.data 1024 1024 0 0.0
.data.rel.ro 161208 161208 0 0.0
.dynamic 592 592 0 0.0
.got 4472 4472 0 0.0
.init 27 27 0 0.0
.init_array 568 568 0 0.0
.rodata 307640 307640 0 0.0
.text 5904133 5904133 0 0.0
lighting-app debug+rpc (read only) 1710801 1710833 32 0.0
(read/write) 107648 107648 0 0.0
.bss 41936 41936 0 0.0
.data 1280 1280 0 0.0
.data.rel.ro 59056 59056 0 0.0
.dynamic 608 608 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 616 616 0 0.0
.rodata 140721 140721 0 0.0
.text 1427410 1427442 32 0.0
ota-provider-app debug (read only) 1386329 1386329 0 0.0
(read/write) 72816 72816 0 0.0
.bss 38816 38816 0 0.0
.data 928 928 0 0.0
.data.rel.ro 27880 27880 0 0.0
.dynamic 592 592 0 0.0
.got 4056 4056 0 0.0
.init 27 27 0 0.0
.init_array 520 520 0 0.0
.rodata 121448 121448 0 0.0
.text 1160194 1160194 0 0.0
ota-requestor-app debug (read only) 1490137 1490137 0 0.0
(read/write) 76784 76784 0 0.0
.bss 40960 40960 0 0.0
.data 992 992 0 0.0
.data.rel.ro 29592 29592 0 0.0
.dynamic 592 592 0 0.0
.got 4072 4072 0 0.0
.init 27 27 0 0.0
.init_array 552 552 0 0.0
.rodata 133776 133776 0 0.0
.text 1247666 1247666 0 0.0
shell debug (read only) 819625 819625 0 0.0
(read/write) 60584 60584 0 0.0
.bss 16936 16936 0 0.0
.data 256 256 0 0.0
.data.rel.ro 38936 38936 0 0.0
.dynamic 592 592 0 0.0
.got 3512 3512 0 0.0
.init 27 27 0 0.0
.init_array 344 344 0 0.0
.rodata 83570 83570 0 0.0
.text 629314 629314 0 0.0
tv-app debug (read only) 2020441 2020473 32 0.0
(read/write) 320000 320000 0 0.0
.bss 247224 247224 0 0.0
.data 2768 2768 0 0.0
.data.rel.ro 64200 64200 0 0.0
.dynamic 592 592 0 0.0
.got 4432 4432 0 0.0
.init 27 27 0 0.0
.init_array 736 736 0 0.0
.rodata 173608 173608 0 0.0
.text 1692354 1692386 32 0.0
mbed all-clusters-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2309224 2309160 -64 -0.0
.bss 179636 179636 0 0.0
.data 5184 5184 0 0.0
.heap 851624 851624 0 0.0
.text 1271800 1271736 -64 -0.0
lighting-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2295616 2295552 -64 -0.0
.bss 173272 173272 0 0.0
.data 5496 5496 0 0.0
.heap 857680 857680 0 0.0
.text 1258216 1258152 -64 -0.0
lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2268648 2268584 -64 -0.0
.bss 172088 172088 0 0.0
.data 5496 5496 0 0.0
.heap 858864 858864 0 0.0
.text 1231248 1231184 -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) 2046960 2046960 0 0.0
.bss 156732 156732 0 0.0
.data 4872 4872 0 0.0
.heap 874840 874840 0 0.0
.text 1009560 1009560 0 0.0
nrfconnect lighting-app nrf52840dk_nrf52840 (read/write) 891475 891395 -80 -0.0
bss 113756 113756 0 0.0
rodata 99428 99428 0 0.0
text 602740 602668 -72 -0.0
nrf52840dk_nrf52840+rpc (read/write) 854851 854771 -80 -0.0
bss 110104 110104 0 0.0
rodata 90788 90788 0 0.0
text 577736 577664 -72 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 817370 817306 -64 -0.0
bss 115128 115128 0 0.0
rodata 94684 94684 0 0.0
text 533076 533008 -68 -0.0
lock-app nrf52840dk_nrf52840 (read/write) 862331 862251 -80 -0.0
bss 110792 110792 0 0.0
rodata 95164 95164 0 0.0
text 580992 580920 -72 -0.0
nrf5340dk_nrf5340_cpuapp (read/write) 788486 788406 -80 -0.0
bss 112204 112204 0 0.0
rodata 90456 90456 0 0.0
text 511420 511352 -68 -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) 868347 868267 -80 -0.0
bss 110928 110928 0 0.0
rodata 96900 96900 0 0.0
text 585056 584988 -68 -0.0
pump-controller-app nrf52840dk_nrf52840 (read/write) 861411 861347 -64 -0.0
bss 110808 110808 0 0.0
rodata 95036 95036 0 0.0
text 580116 580048 -68 -0.0
shell nrf52840dk_nrf52840 (read/write) 779891 779891 0 0.0
bss 109696 109696 0 0.0
rodata 73792 73792 0 0.0
text 521908 521908 0 0.0
nrf5340dk_nrf5340_cpuapp (read/write) 694934 694934 0 0.0
bss 110680 110680 0 0.0
rodata 68432 68432 0 0.0
text 442512 442512 0 0.0
p6 all-clusters-app default (read/write) 2339504 2339216 -288 -0.0
.bss 107820 107820 0 0.0
.data 2456 2456 0 0.0
.heap 923064 923064 0 0.0
.text 1297768 1297480 -288 -0.0
light-app default (read/write) 2278856 2278568 -288 -0.0
.bss 98504 98504 0 0.0
.data 2336 2336 0 0.0
.heap 932504 932504 0 0.0
.text 1237120 1236832 -288 -0.0
lock-app default (read/write) 2254208 2253904 -304 -0.0
.bss 97160 97160 0 0.0
.data 2296 2296 0 0.0
.heap 933888 933888 0 0.0
.text 1212472 1212168 -304 -0.0
qpg lighting-app qpg6100+debug (read only) 510500 510436 -64 -0.0
(read/write) 122332 122332 0 0.0
.bss 80272 80272 0 0.0
.data 964 964 0 0.0
.text 505180 505116 -64 -0.0
lock-app qpg6100+debug (read only) 483308 483244 -64 -0.0
(read/write) 122332 122332 0 0.0
.bss 79184 79184 0 0.0
.data 916 916 0 0.0
.text 477988 477924 -64 -0.0
persistent-storage-app qpg6100+debug (read only) 108208 108208 0 0.0
(read/write) 122332 122332 0 0.0
.bss 36696 36696 0 0.0
.data 292 292 0 0.0
.text 102888 102888 0 0.0
telink lighting-app tlsr9518adk80d (read/write) 794566 794438 -128 -0.0
bss 80332 80332 0 0.0
noinit 37160 37160 0 0.0
text 554526 554394 -132 -0.0

@bzbarsky-apple bzbarsky-apple merged commit 0315b48 into project-chip:master Dec 3, 2021
@bzbarsky-apple bzbarsky-apple deleted the better-endpoint-looping branch December 3, 2021 23:31
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