-
Notifications
You must be signed in to change notification settings - Fork 104
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
refactor: optimize wireformat size #4502
base: master
Are you sure you want to change the base?
Conversation
We don't expect utf8 characters for preprocessor conditions. chore: 0
master=seia-soto:resources-checking, d4281c5
seia-soto:optimize-wireformat-0, 64287d0
|
@@ -389,17 +398,14 @@ export default class Resources { | |||
} | |||
|
|||
estimatedSize += 2 * sizeOfByte(); | |||
estimatedSize += this.scriptlets.length; // mask |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't multiply the single byte size which equals to 1
. I recall that I got a feedback regarding this before. I'll multiply by the size of single byte to make the code verbose. Sorry.
for (const alias of aliases) { | ||
buffer.pushASCII(alias); | ||
} | ||
aliases.forEach((alias) => buffer.pushASCII(alias)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit. I don't see this necessarily as an improvement given we use for .. of
in other places.
This improves binary size by