-
Notifications
You must be signed in to change notification settings - Fork 4
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 #22
Comments
Hi @Rishi321. I'm still hoping to merge with https://github.com/AdCombo/flask-combo-jsonapi, so there is some chance you could ask this question over there. To answer your question, though, I believe it's fairly core to this library that we can create Schema instances on the fly. For example, if the user requests certain relationships or certain fields via query params, we have to create a new schema that includes these fields, and this has to happen per request. Consider this function, which does exactly that (builds a schema instance based on the query string): https://github.com/TMiguelT/flapison/blob/379b37774fd16197c803a7b5e3bd9eca99191337/flapison/schema.py#L12-L90. How could we make this compatible with |
Sorry for skipping out on the answer for so long, my attention was diverted to other projects. |
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?
I tried changing the code and using an in-memory object dict as an object cache, but toastedmarshmallow still made no performance impact.
Anybody tried this before?
Also posted here: miLibris#192
The text was updated successfully, but these errors were encountered: