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

Using toastedmarshmallow for JIT #192

Open
Rishi321 opened this issue Sep 8, 2020 · 1 comment
Open

Using toastedmarshmallow for JIT #192

Rishi321 opened this issue Sep 8, 2020 · 1 comment

Comments

@Rishi321
Copy link

Rishi321 commented Sep 8, 2020

Has this library been tested with ToastedMarshmallow?
We have been using this library to great effect recently in a project (for about 8 months), but we're now seeing some performance hits during the Marshmallow serialization (sometimes 100's of ms) when dealing with many objects (100's)

I've seen people talk about ToastedMarshmallow and notice that the compute_schema recreates schema instances everytime, according to the ToastedMarshmallow documentation this will reduce the gain heavily.

Is there a reason we recreate schema objects every time? If not, what would be the best way to change the code to allow one schema object per resource?

@Rishi321
Copy link
Author

Rishi321 commented Sep 8, 2020

Ok, I see that every request may end up with a new schema based on the includes and other attributes, but when calling these from an API client there will be only a subset in use.

Caching the compute schema output would work, however the arguments will cause problems since qs and include are objects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant