Shane
(Shane Harvey)
7
I hope this is the right place to ask. I’ve tried switching to mongoengine in the past and, even though the API is almost the same, mongoengine was way slower than PyMODM.
PyMODM has an optimization built in such that Model fields are lazily decoded when they’re first accessed. This optimization means applications with large or deeply nested Models do not pay the full cost of deserialization when accessing a few fields. I believe that mongoengine has worse performance in these cases because it fully decodes the entire Model, including all embedded Models within. It may be possible to get this lazy decoding feature implemented in mongoengine.
1 Like