-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use smaller enum types to reduce object sizes. #207
Conversation
If a model has lots of enums, making them smaller instead of 64-bit NSInteger types will help. Apple only uses 64-bit enums since they need to guarantee binary compatibility for years, even after they add new enum values. Since this is generated source and re-compiled into applications, this does not apply. Building the integration models works. However Pinterest builds with -Werror -Wconversion. This means the -decodeIntegerForKey: needs a cast to the enumeration type name. However down in decodeStatement I do not see how to get the enumeration type name for casting. This is only applicable to ObjC, since it is the place where these C types will save some space.
…tegory to group them together in memory layout.
Thanks! Co-Authored-By: Jon Parise <[email protected]>
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.
👍 from me.
@rahul-malik made some good comments, and I defer to him on the final sign-off.
Here is the conflict since GH isn't loading it...
|
Everything is additive, and the code changes both add code to the same location in the generated file. Is there a proper way to rebase this diff on top of master to get those |
Doesn't |
After running that, my repository is clean. I do not know how to proceed here. I verified that this branch is up-to-date with origin/master (it has bdd00b0). I run all the What code currently (or used to) generate the following? I can't seem to figure this out.
|
aha i needed to merge an upstream branch, not my fork's master. :| |
If a model has lots of enums, making them smaller instead of 64-bit NSInteger types will help. Apple only uses 64-bit enums since they need to guarantee binary compatibility for years, even after they add new enum values. Since this is generated source and re-compiled into applications, this does not apply.
Pinterest builds with -Werror -Wconversion. This means the -decodeIntegerForKey: needs a cast to the enumeration type name. Same goes for -initWithModelDictionary:.
This is only applicable to ObjC, since it is the place where these C types will save some space.