forked from doctrine/dbal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize TypeRegistry::lookupName() from O(N) to O(1) (doctrine#6082)
| Q | A |------------- | ----------- | Type | performance issue | Fixed issues | n/a #### Summary We use a lot of custom types and migration from `Type::getName()` to `TypeRegistry->lookupName()` discovered us the reverse lookup was very slow (O(N)). This PR makes it O(1). ~Index is initialized lazily on the 1st reverse lookup.~ The type registry is expected to not hold duplicate type instances and this PR fixes it, in doctrine#6083 (comment) I was requested to fix it in this PR instead of a separate one.
- Loading branch information
Showing
2 changed files
with
28 additions
and
16 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