forked from mongodb/mongoid
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use type in inheritance situations.
This is mostly a performance related change, but instead of always having _type field defined and suffering the inheritance check every time we apply defaults, we now only define it once something has been subclassed. The perf implications on 150k iterations: Before: Load from DB 4.580000 0.010000 4.590000 ( 4.660224) Instantiation 4.900000 0.000000 4.900000 ( 4.904462) After: Load from DB 2.840000 0.010000 2.850000 ( 2.910107) Instantiation 3.540000 0.000000 3.540000 ( 3.542787)
- Loading branch information
Showing
3 changed files
with
9 additions
and
3 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
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
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