-
Notifications
You must be signed in to change notification settings - Fork 3
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
Change type of MongoDocuments to MutableMapping #87
Comments
attr.s classes implementing MutableMapping are equally good |
|
Related issue: |
All tests green when using real mongo database in tests |
Mongomock does not work correctly with objects implementing Mapping which are not dicts. This change adds dict conversion to objects before saving which defeats the benefits of using slotted classes. Fix #87
By changing the type of
MongoDocument
s to slottedMutableMapping
we can gain 2.3x performance boost at object creation and 4.7x less memory used compared todict
.All of that at the cost of some boilerplate code implementing item access and manipulation methods.
The text was updated successfully, but these errors were encountered: