-
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
[tlv] Optimize code size of processing context tags #24224
Merged
Merged
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
pullapprove
bot
requested review from
andy31415,
anush-apple,
arkq,
Byungjoo-Lee,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
dhrishi,
electrocucaracha,
emargolis,
franck-apple,
gjc13,
harsha-rajendran,
hawk248,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jtung-apple,
ksperling-apple,
lazarkov,
lpbeliveau-silabs,
LuDuda,
mlepage-google,
mrjerryjohns,
msandstedt and
rgoliver
January 2, 2023 07:25
pullapprove
bot
requested review from
tecimovic,
tehampson,
turon,
vijs,
vivien-apple,
woody-apple,
xylophone21 and
yufengwangca
January 2, 2023 07:25
PR #24224: Size comparison from 19c8ea4 to 18216bf Increases above 0.2%:
Increases (9 builds for bl602, bl702, linux, telink)
Decreases (14 builds for bl702, k32w, linux, mbed, nrfconnect, qpg, telink)
Full report (21 builds for bl602, bl702, k32w, linux, mbed, nrfconnect, qpg, telink)
|
Damian-Nordic
force-pushed
the
tlv-opt-2
branch
from
January 2, 2023 08:29
18216bf
to
51f3ee4
Compare
PR #24224: Size comparison from 19c8ea4 to 51f3ee4 Increases (1 build for linux)
Decreases (11 builds for k32w, linux, mbed, nrfconnect, qpg)
Full report (11 builds for k32w, linux, mbed, nrfconnect, qpg)
|
Damian-Nordic
force-pushed
the
tlv-opt-2
branch
from
January 2, 2023 09:06
51f3ee4
to
09097b0
Compare
PR #24224: Size comparison from 19c8ea4 to 09097b0 Increases above 0.2%:
Increases (22 builds for bl602, bl702, cc13x2_26x2, esp32, linux, psoc6, telink)
Decreases (45 builds for bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg)
Full report (53 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
Make the internal representation of Tag private so that it is easier and safer to change it. Signed-off-by: Damian Krolik <[email protected]>
TLV tag is represented as uint64_t that encodes the following components: - 16-bit vendor ID - 16-bit profile number - 32-bit tag number Context tags, which account for vast majority of tag usage in the SDK, are encoded as having both vendor ID and profile number equal to 0xFFFF. Anonymous tags are encoded in the same way, but using 0xFFFFFFFF tag number. This is correct because vendor IDs higher than 0xFFF0 shall not be assigned to real manufacturers, but constructing 0xFF... constants in hundreds of places adds non-negligible overhead to the flash usage. Encode profile ID in the negated form internally to optimize the code size when using special tags.
Damian-Nordic
force-pushed
the
tlv-opt-2
branch
from
January 4, 2023 07:40
09097b0
to
72e9d23
Compare
PR #24224: Size comparison from 23e5fb2 to 72e9d23 Increases above 0.2%:
Increases (15 builds for bl602, bl702, linux, psoc6, telink)
Decreases (27 builds for bl702, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg)
Full report (35 builds for bl602, bl702, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
andy31415
approved these changes
Jan 4, 2023
bzbarsky-apple
approved these changes
Jan 4, 2023
lecndav
pushed a commit
to lecndav/connectedhomeip
that referenced
this pull request
Mar 22, 2023
* [tlv] Encapsulate Tag encoding Make the internal representation of Tag private so that it is easier and safer to change it. Signed-off-by: Damian Krolik <[email protected]> * [tlv] Optimize code size of processing context tags TLV tag is represented as uint64_t that encodes the following components: - 16-bit vendor ID - 16-bit profile number - 32-bit tag number Context tags, which account for vast majority of tag usage in the SDK, are encoded as having both vendor ID and profile number equal to 0xFFFF. Anonymous tags are encoded in the same way, but using 0xFFFFFFFF tag number. This is correct because vendor IDs higher than 0xFFF0 shall not be assigned to real manufacturers, but constructing 0xFF... constants in hundreds of places adds non-negligible overhead to the flash usage. Encode profile ID in the negated form internally to optimize the code size when using special tags. * Fix build * Code review Signed-off-by: Damian Krolik <[email protected]>
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.
TLV tag is represented as uint64_t that encodes the following components:
Context tags, which account for vast majority of tag usage in the SDK, are encoded as having both vendor ID and profile
number equal to 0xFFFF. Anonymous tags are encoded in the same way, but using 0xFFFFFFFF tag number.
This is correct because vendor IDs higher than 0xFFF0 shall not be assigned to real manufacturers, but constructing
0xFF... constants in hundreds of places adds non-negligible overhead to the flash usage.
Make the internal representation of Tag private so that it is easier and safer to change it.
Encode profile ID in the negated form internally to optimize the code size when using special tags.