Implement lazy loading of php class for proto messages#6911
Merged
TeBoring merged 5 commits intoprotocolbuffers:masterfrom Nov 21, 2019
Merged
Implement lazy loading of php class for proto messages#6911TeBoring merged 5 commits intoprotocolbuffers:masterfrom
TeBoring merged 5 commits intoprotocolbuffers:masterfrom
Conversation
stanley-cheung
approved these changes
Nov 20, 2019
| return; | ||
| } | ||
|
|
||
| // Ensure layout exists. We may be invoked to create handlers for a given |
Contributor
There was a problem hiding this comment.
I don't understand why we can remove this
Contributor
Author
There was a problem hiding this comment.
This has been done in register_class
| bool use_nested_submsg TSRMLS_DC); | ||
| void init_generated_pool_once(TSRMLS_D); | ||
| void add_handlers_for_message(const void* closure, upb_handlers* h); | ||
| void register_class(void *desc, bool is_enum TSRMLS_DC); |
Contributor
There was a problem hiding this comment.
So is register_class a function that already existed before this PR?
Contributor
Author
There was a problem hiding this comment.
It existed as a static method in def.c.
In this change, I refactored a little to make it easy to use.
rafi-kamal
pushed a commit
to rafi-kamal/protobuf
that referenced
this pull request
Nov 21, 2019
…rs#6911) * Implement lazy loading of php class for proto messages * Fix php 7.1 * Fix encode * Fix memory leak * Fix enum descriptor
rafi-kamal
added a commit
that referenced
this pull request
Nov 22, 2019
nlhien
pushed a commit
to nlhien/protobuf
that referenced
this pull request
Feb 28, 2020
…rs#6911) * Implement lazy loading of php class for proto messages * Fix php 7.1 * Fix encode * Fix memory leak * Fix enum descriptor
This file contains hidden or 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
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.
Previously, when creating a message, all messages defined in the same proto file and transitive proto files need to be resolved by php engine, even though some of them are not needed.
This change lazily resolve php classes of proto messages, so that they are only needed if the actual message is created.