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

Add a lighweight size-computation method on DecodableList. #10801

Conversation

bzbarsky-apple
Copy link
Contributor

Just computes an optimistic size, without checking whether the
individual items decode properly.

Problem

Repeated code computing the size.

Change overview

Add a helper.

Testing

No behavior changes.

@github-actions
Copy link

PR #10801: Size comparison from 49727db to 523a4da

7 builds (for k32w, p6, qpg)
platform target config section 49727db 523a4da change % change
k32w lock-app k32w061+debug .bss 69060 69060 0 0.0
.data 1864 1864 0 0.0
.text 514680 514680 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 357416 357416 0 0.0
lighting-app k32w061+se05x+release .bss 78584 78584 0 0.0
.data 1900 1900 0 0.0
.text 613464 613464 0 0.0
p6 lock-app default .bss 68208 68208 0 0.0
.data 2416 2416 0 0.0
.heap 962720 962720 0 0.0
.text 1125456 1125456 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 996 996 0 0.0
.text 485628 485628 0 0.0
lock-app qpg6100+debug .bss 52496 52496 0 0.0
.data 952 952 0 0.0
.text 461716 461716 0 0.0
persistent-storage-app qpg6100+debug .bss 17778 17778 0 0.0
.data 280 280 0 0.0
.text 102756 102756 0 0.0

@github-actions
Copy link

github-actions bot commented Oct 21, 2021

PR #10801: Size comparison from ea1b443 to 2505a36

12 builds (for efr32, k32w, p6, qpg, telink)
platform target config section ea1b443 2505a36 change % change
efr32 lighting-app BRD4161A .bss 118028 118028 0 0.0
.data 1800 1800 0 0.0
.text 781632 781632 0 0.0
lock-app BRD4161A .bss 115884 115884 0 0.0
.data 1760 1760 0 0.0
.text 760776 760776 0 0.0
window-app BRD4161A .bss 116204 116204 0 0.0
.data 1764 1764 0 0.0
.text 761684 761684 0 0.0
lighting-app BRD4161A+rpc .bss 131356 131356 0 0.0
.data 1852 1852 0 0.0
.text 761332 761332 0 0.0
k32w lock-app k32w061+debug .bss 69060 69060 0 0.0
.data 1864 1864 0 0.0
.text 514552 514552 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 357288 357288 0 0.0
lighting-app k32w061+se05x+release .bss 78584 78584 0 0.0
.data 1900 1900 0 0.0
.text 613320 613320 0 0.0
p6 lock-app default .bss 68208 68208 0 0.0
.data 2416 2416 0 0.0
.heap 962720 962720 0 0.0
.text 1125280 1125280 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 996 996 0 0.0
.text 485508 485508 0 0.0
lock-app qpg6100+debug .bss 52496 52496 0 0.0
.data 952 952 0 0.0
.text 461588 461588 0 0.0
persistent-storage-app qpg6100+debug .bss 17778 17778 0 0.0
.data 280 280 0 0.0
.text 102628 102628 0 0.0
telink lighting-app tlsr9518adk80d bss 70992 70992 0 0.0
noinit 33216 33216 0 0.0
text 457130 457130 0 0.0
2 builds (for mbed)
platform target config section ea1b443 2505a36 change % change
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172092 172092 0 0.0
.data 5464 5464 0 0.0
.heap 858888 858888 0 0.0
.text 1219008 1219008 0 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171012 171012 0 0.0
.data 5432 5432 0 0.0
.heap 860000 860000 0 0.0
.text 1196904 1196904 0 0.0
2 builds (for esp32)
platform target config section ea1b443 2505a36 change % change
esp32 all-clusters-app c3devkit .dram0.bss 60296 60296 0 0.0
.dram0.data 16432 16432 0 0.0
.flash.rodata 199072 199072 0 0.0
.flash.text 873126 873170 44 0.0
.iram0.text 57564 57564 0 0.0
m5stack .dram0.bss 62800 62800 0 0.0
.dram0.data 32084 32084 0 0.0
.flash.rodata 207832 207832 0 0.0
.flash.text 904179 904175 -4 -0.0
.iram0.text 125115 125115 0 0.0

@github-actions
Copy link

github-actions bot commented Oct 22, 2021

PR #10801: Size comparison from 0c16976 to 4c83c8f

22 builds (for efr32, k32w, linux, mbed, p6, qpg, telink)
platform target config section 0c16976 4c83c8f change % change
efr32 lighting-app BRD4161A .bss 118028 118028 0 0.0
.data 1800 1800 0 0.0
.text 784328 784328 0 0.0
lock-app BRD4161A .bss 115884 115884 0 0.0
.data 1760 1760 0 0.0
.text 763456 763456 0 0.0
window-app BRD4161A .bss 116204 116204 0 0.0
.data 1764 1764 0 0.0
.text 764380 764380 0 0.0
lighting-app BRD4161A+rpc .bss 131356 131356 0 0.0
.data 1852 1852 0 0.0
.text 764028 764028 0 0.0
k32w lock-app k32w061+debug .bss 69060 69060 0 0.0
.data 1864 1864 0 0.0
.text 516068 516068 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 359544 359544 0 0.0
lighting-app k32w061+se05x+release .bss 78592 78592 0 0.0
.data 1900 1900 0 0.0
.text 614836 614836 0 0.0
linux all-clusters-app debug .bss 52208 52208 0 0.0
.data 978 978 0 0.0
.data.rel.ro 60384 60384 0 0.0
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 136405 136405 0 0.0
.text 1352290 1352834 544 0.0
chip-tool debug .bss 17712 17712 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 93504 93504 0 0.0
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 416 416 0 0.0
.rodata 193860 193860 0 0.0
.text 3502693 3503157 464 0.0
ota-provider-app debug .bss 37472 37472 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 110248 110248 0 0.0
.text 1022226 1022226 0 0.0
ota-requestor-app debug .bss 205728 205728 0 0.0
.data 752 752 0 0.0
.data.rel.ro 25800 25800 0 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 128392 128392 0 0.0
.text 1140786 1140786 0 0.0
shell debug .bss 16136 16136 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36496 36496 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 76463 76463 0 0.0
.text 597346 597346 0 0.0
tv-app debug .bss 216592 216592 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 57408 57408 0 0.0
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 152904 152904 0 0.0
.text 1452706 1452706 0 0.0
bridge-app debug+rpc .bss 52912 52912 0 0.0
.data 976 976 0 0.0
.data.rel.ro 27112 27112 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110748 110748 0 0.0
.text 1063173 1063173 0 0.0
lighting-app debug+rpc .bss 42232 42232 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 53808 53808 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127921 127921 0 0.0
.text 1261170 1261170 0 0.0
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172100 172100 0 0.0
.data 5464 5464 0 0.0
.heap 858880 858880 0 0.0
.text 1220088 1220088 0 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171020 171020 0 0.0
.data 5432 5432 0 0.0
.heap 859992 859992 0 0.0
.text 1197984 1197984 0 0.0
p6 lock-app default .bss 68216 68216 0 0.0
.data 2416 2416 0 0.0
.heap 962712 962712 0 0.0
.text 1126688 1126688 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 1004 1004 0 0.0
.text 485972 485972 0 0.0
lock-app qpg6100+debug .bss 52496 52496 0 0.0
.data 960 960 0 0.0
.text 462060 462060 0 0.0
persistent-storage-app qpg6100+debug .bss 27840 27840 0 0.0
.data 372 372 0 0.0
.text 149896 149896 0 0.0
telink lighting-app tlsr9518adk80d bss 70996 70996 0 0.0
noinit 33216 33216 0 0.0
text 457630 457630 0 0.0
10 builds (for nrfconnect)
platform target config section 0c16976 4c83c8f change % change
nrfconnect lighting-app nrf52840dk_nrf52840 bss 113176 113176 0 0.0
rodata 98076 98076 0 0.0
text 577104 577104 0 0.0
lock-app nrf52840dk_nrf52840 bss 112244 112244 0 0.0
rodata 94412 94412 0 0.0
text 558592 558592 0 0.0
pigweed-app nrf52840dk_nrf52840 bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339456 339456 0 0.0
pump-app nrf52840dk_nrf52840 bss 112312 112312 0 0.0
rodata 95396 95396 0 0.0
text 561744 561744 0 0.0
pump-controller-app nrf52840dk_nrf52840 bss 112252 112252 0 0.0
rodata 94472 94472 0 0.0
text 558384 558384 0 0.0
shell nrf52840dk_nrf52840 bss 109072 109072 0 0.0
rodata 72524 72524 0 0.0
text 520208 520208 0 0.0
lighting-app nrf52840dk_nrf52840+rpc bss 109420 109420 0 0.0
rodata 88856 88856 0 0.0
text 550296 550296 0 0.0
nrf5340dk_nrf5340_cpuapp bss 114552 114552 0 0.0
rodata 93316 93316 0 0.0
text 506572 506572 0 0.0
lock-app nrf5340dk_nrf5340_cpuapp bss 113616 113616 0 0.0
rodata 89672 89672 0 0.0
text 488056 488056 0 0.0
shell nrf5340dk_nrf5340_cpuapp bss 110056 110056 0 0.0
rodata 67168 67168 0 0.0
text 440816 440816 0 0.0

Just computes an optimistic size, without checking whether the
individual items decode properly.
@github-actions
Copy link

Size increase report for "esp32-example-build" from 0c16976

File Section File VM
chip-all-clusters-app.elf .flash.text 40 40
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_info,0,5363
.debug_str,0,2010
.debug_line,0,196
.flash.text,40,40
.debug_frame,0,20
.shstrtab,0,1
.riscv.attributes,0,-2
.strtab,0,-9
.debug_ranges,0,-16
[Unmapped],0,-40
.debug_loc,0,-171


@github-actions
Copy link

github-actions bot commented Oct 22, 2021

PR #10801: Size comparison from 0c16976 to 0c66ddb

8 builds (for k32w, p6, qpg, telink)
platform target config section 0c16976 0c66ddb change % change
k32w lock-app k32w061+debug .bss 69060 69060 0 0.0
.data 1864 1864 0 0.0
.text 516068 516068 0 0.0
shell k32w061+debug .bss 55080 55080 0 0.0
.data 672 672 0 0.0
.text 359544 359544 0 0.0
lighting-app k32w061+se05x+release .bss 78592 78592 0 0.0
.data 1900 1900 0 0.0
.text 614836 614836 0 0.0
p6 lock-app default .bss 68216 68216 0 0.0
.data 2416 2416 0 0.0
.heap 962712 962712 0 0.0
.text 1126688 1126688 0 0.0
qpg lighting-app qpg6100+debug .bss 53552 53552 0 0.0
.data 1004 1004 0 0.0
.text 485972 485972 0 0.0
lock-app qpg6100+debug .bss 52496 52496 0 0.0
.data 960 960 0 0.0
.text 462060 462060 0 0.0
persistent-storage-app qpg6100+debug .bss 27840 27840 0 0.0
.data 372 372 0 0.0
.text 149896 149896 0 0.0
telink lighting-app tlsr9518adk80d bss 70996 70996 0 0.0
noinit 33216 33216 0 0.0
text 457630 457630 0 0.0
14 builds (for efr32, linux, mbed)
platform target config section 0c16976 0c66ddb change % change
efr32 lighting-app BRD4161A .bss 118028 118028 0 0.0
.data 1800 1800 0 0.0
.text 784328 784328 0 0.0
lock-app BRD4161A .bss 115884 115884 0 0.0
.data 1760 1760 0 0.0
.text 763456 763456 0 0.0
window-app BRD4161A .bss 116204 116204 0 0.0
.data 1764 1764 0 0.0
.text 764380 764380 0 0.0
lighting-app BRD4161A+rpc .bss 131356 131356 0 0.0
.data 1852 1852 0 0.0
.text 764028 764028 0 0.0
linux all-clusters-app debug .bss 52208 52208 0 0.0
.data 978 978 0 0.0
.data.rel.ro 60384 60384 0 0.0
.dynamic 592 592 0 0.0
.got 4088 4088 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 136405 136405 0 0.0
.text 1352290 1352834 544 0.0
chip-tool debug .bss 17712 17712 0 0.0
.data 1584 1584 0 0.0
.data.rel.ro 93504 93504 0 0.0
.dynamic 592 592 0 0.0
.got 4368 4368 0 0.0
.init 27 27 0 0.0
.init_array 416 416 0 0.0
.rodata 193860 193860 0 0.0
.text 3502693 3503157 464 0.0
ota-provider-app debug .bss 37472 37472 0 0.0
.data 752 752 0 0.0
.data.rel.ro 24488 24488 0 0.0
.dynamic 592 592 0 0.0
.got 4016 4016 0 0.0
.init 27 27 0 0.0
.init_array 440 440 0 0.0
.rodata 110248 110248 0 0.0
.text 1022226 1022226 0 0.0
ota-requestor-app debug .bss 205728 205728 0 0.0
.data 752 752 0 0.0
.data.rel.ro 25800 25800 0 0.0
.dynamic 592 592 0 0.0
.got 4144 4144 0 0.0
.init 27 27 0 0.0
.init_array 512 512 0 0.0
.rodata 128392 128392 0 0.0
.text 1140786 1140786 0 0.0
shell debug .bss 16136 16136 0 0.0
.data 242 242 0 0.0
.data.rel.ro 36496 36496 0 0.0
.dynamic 592 592 0 0.0
.got 3528 3528 0 0.0
.init 27 27 0 0.0
.init_array 336 336 0 0.0
.rodata 76463 76463 0 0.0
.text 597346 597346 0 0.0
tv-app debug .bss 216592 216592 0 0.0
.data 2032 2032 0 0.0
.data.rel.ro 57408 57408 0 0.0
.dynamic 592 592 0 0.0
.got 4408 4408 0 0.0
.init 27 27 0 0.0
.init_array 608 608 0 0.0
.rodata 152904 152904 0 0.0
.text 1452706 1452706 0 0.0
bridge-app debug+rpc .bss 52912 52912 0 0.0
.data 976 976 0 0.0
.data.rel.ro 27112 27112 0 0.0
.dynamic 592 592 0 0.0
.got 3952 3952 0 0.0
.init 27 27 0 0.0
.init_array 400 400 0 0.0
.rodata 110748 110748 0 0.0
.text 1063173 1063173 0 0.0
lighting-app debug+rpc .bss 42232 42232 0 0.0
.data 1106 1106 0 0.0
.data.rel.ro 53808 53808 0 0.0
.dynamic 608 608 0 0.0
.got 4112 4112 0 0.0
.init 27 27 0 0.0
.init_array 528 528 0 0.0
.rodata 127921 127921 0 0.0
.text 1261170 1261170 0 0.0
mbed lighting-app CY8CPROTO_062_4343W+release .bss 172100 172100 0 0.0
.data 5464 5464 0 0.0
.heap 858880 858880 0 0.0
.text 1220088 1220088 0 0.0
lock-app CY8CPROTO_062_4343W+release .bss 171020 171020 0 0.0
.data 5432 5432 0 0.0
.heap 859992 859992 0 0.0
.text 1197984 1197984 0 0.0
10 builds (for nrfconnect)
platform target config section 0c16976 0c66ddb change % change
nrfconnect lighting-app nrf52840dk_nrf52840 bss 113176 113176 0 0.0
rodata 98076 98076 0 0.0
text 577104 577104 0 0.0
lock-app nrf52840dk_nrf52840 bss 112244 112244 0 0.0
rodata 94412 94412 0 0.0
text 558592 558592 0 0.0
pigweed-app nrf52840dk_nrf52840 bss 51824 51824 0 0.0
rodata 45776 45776 0 0.0
text 339456 339456 0 0.0
pump-app nrf52840dk_nrf52840 bss 112312 112312 0 0.0
rodata 95396 95396 0 0.0
text 561744 561744 0 0.0
pump-controller-app nrf52840dk_nrf52840 bss 112252 112252 0 0.0
rodata 94472 94472 0 0.0
text 558384 558384 0 0.0
shell nrf52840dk_nrf52840 bss 109072 109072 0 0.0
rodata 72524 72524 0 0.0
text 520208 520208 0 0.0
lighting-app nrf52840dk_nrf52840+rpc bss 109420 109420 0 0.0
rodata 88856 88856 0 0.0
text 550296 550296 0 0.0
nrf5340dk_nrf5340_cpuapp bss 114552 114552 0 0.0
rodata 93316 93316 0 0.0
text 506572 506572 0 0.0
lock-app nrf5340dk_nrf5340_cpuapp bss 113616 113616 0 0.0
rodata 89672 89672 0 0.0
text 488056 488056 0 0.0
shell nrf5340dk_nrf5340_cpuapp bss 110056 110056 0 0.0
rodata 67168 67168 0 0.0
text 440816 440816 0 0.0
2 builds (for esp32)
platform target config section 0c16976 0c66ddb change % change
esp32 all-clusters-app c3devkit .dram0.bss 60296 60296 0 0.0
.dram0.data 16440 16440 0 0.0
.flash.rodata 199864 199864 0 0.0
.flash.text 874330 874370 40 0.0
.iram0.text 57564 57564 0 0.0
m5stack .dram0.bss 62800 62800 0 0.0
.dram0.data 32084 32084 0 0.0
.flash.rodata 208600 208600 0 0.0
.flash.text 905263 905283 20 0.0
.iram0.text 125115 125115 0 0.0

@bzbarsky-apple bzbarsky-apple merged commit ab8cc00 into project-chip:master Oct 25, 2021
@bzbarsky-apple bzbarsky-apple deleted the add-decodable-list-size-compute branch October 25, 2021 16:03
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.

None yet

6 participants