-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Speed up crud operations. This fixes [#129](#129). Because of `_conversion_checks` the complexity of a single `__setattr__` is something like O(number_of_keys * key_size). Hence the complexity of merge_update would be O(number_of_keys * number_of_keys * key_size). This comes as a surprise when you expect the complexity to be O(number_of_keys * log(number_of_keys)). This PR addresses this performance issue by using a dictionary mapping safe keys to old keys. All the unit tests are passing. I am not familiar enough with Box to know if the use of `__setattr__` and `__setitem__` might lead to an inconsistent state of the Box, or if the unit tests cover this. Eventually, you might consider refactoring the code a bit (this is better done by the author who knows the code well). * Fix linter errors
- Loading branch information
Showing
1 changed file
with
49 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters