-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Refactored OnboardingCodesUtil to decrease memory footprint. #18318
Merged
andy31415
merged 6 commits into
project-chip:master
from
kkasperczyk-no:memory_optimizaiton
May 16, 2022
Merged
Refactored OnboardingCodesUtil to decrease memory footprint. #18318
andy31415
merged 6 commits into
project-chip:master
from
kkasperczyk-no:memory_optimizaiton
May 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OnboardingCodesUtil uses SetupPayload object that contains a lot unnecessary data and takes a lot of flash. Replaced using SetupPayload with PayloadContents and QRCodeSetupPayloadGenerator with QRCodeBasicSetupPayloadGenerator. It allowed to save about 3.28 k of flash for nrfconnect platform.
1352528
to
afa597f
Compare
PR #18318: Size comparison from 588d4c9 to afa597f Decreases (3 builds for mbed, nrfconnect, telink)
Full report (3 builds for mbed, nrfconnect, telink)
|
afa597f
to
88389ce
Compare
PR #18318: Size comparison from 588d4c9 to 88389ce Increases above 0.2%:
Increases (5 builds for cc13x2_26x2, linux)
Decreases (16 builds for cc13x2_26x2, cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (18 builds for cc13x2_26x2, cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
|
88389ce
to
1d22155
Compare
PR #18318: Size comparison from 588d4c9 to 1d22155 Increases above 0.2%:
Increases (6 builds for cc13x2_26x2, esp32, linux)
Decreases (18 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (20 builds for cc13x2_26x2, cyw30739, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
* Added documentation for OnboardingCodesUtil methods * Changed char span sizes returned by codes encoding methods to not include null terminator * Aligned examples using GetQRCode and GetManualPairingCode to the new API.
1d22155
to
2011a62
Compare
PR #18318: Size comparison from 588d4c9 to 2011a62 Increases above 0.2%:
Increases (5 builds for cc13x2_26x2, linux)
Decreases (16 builds for cc13x2_26x2, cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (18 builds for cc13x2_26x2, cyw30739, k32w, linux, mbed, nrfconnect, p6, telink)
|
1b7b68f
to
f38d41b
Compare
PR #18318: Size comparison from 588d4c9 to f38d41b Increases above 0.2%:
Increases (8 builds for cc13x2_26x2, efr32, esp32, linux)
Decreases (23 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (25 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
7777a86
to
9b64065
Compare
PR #18318: Size comparison from 80cadfa to 9b64065 Increases above 0.2%:
Increases (11 builds for cc13x2_26x2, efr32, linux)
Decreases (31 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
Full report (34 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
Damian-Nordic
approved these changes
May 13, 2022
bzbarsky-apple
approved these changes
May 14, 2022
andy31415
approved these changes
May 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
OnboardingCodesUtil uses SetupPayload object that contains a lot unnecessary data and takes a lot of flash.
Change overview
Replaced using
SetupPayload
withPayloadContents
andQRCodeSetupPayloadGenerator
withQRCodeBasicSetupPayloadGenerator
.It allowed to save about 3.28 k of flash for nrfconnect platform.
Testing
Verified that generated QR code and manual pairing code is the same before and after the change.