Skip to content
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

[perf] optimize initialize for DPG model #2797

Open
msyyc opened this issue Aug 27, 2024 · 0 comments
Open

[perf] optimize initialize for DPG model #2797

msyyc opened this issue Aug 27, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@msyyc
Copy link
Member

msyyc commented Aug 27, 2024

When DPG model initialize, we will call _get_deserialize_callable_from_annotation to loop all possible types to confirm the deserialization type. And there is same logic when [serialize].(

def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements
)
Actually codegen already knows the type info when generated SDK so the runtime logic could be done when generation so that we could save the time for initialize. For example: we could add parameter serialize_func and deserialize_func for rest_field:

rfc3339: datetime.datetime = rest_field(serialize_func=serialize_rfc3339, deserialize_func=deserialize_rfc3339)
@msyyc msyyc added the p1 label Aug 27, 2024
@msyyc msyyc added this to the Backlog milestone Aug 27, 2024
@msyyc msyyc self-assigned this Aug 27, 2024
@msyyc msyyc changed the title [perf] optimize deserialization for DPG model [perf] optimize initialize for DPG model Aug 27, 2024
@msyyc msyyc closed this as completed Aug 29, 2024
@msyyc msyyc reopened this Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant