Feature #56486

Optimize the ObjectManager for performance

Added by Kobbe van Daatselaar over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-03-03
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

The getCaseSensitiveObjectName operation in the ObjectManager can be optimized for better performance. The loop trough the objects variable is a CPU / time intensive loop.

2 fixes:

1) Cache the cachedLowerCasedObjectNames variable (between requests).
2) If the function returns false, this should also be saved in the cachedLowerCasedObjectNames variable.
Add this line before the return FALSE:
$this->cachedLowerCasedObjectNames[$lowerCasedObjectName] = false;

In my case a 5 - 10 ms performance improvement on a 100ms request.

#1

Updated by Alexander Berl over 7 years ago

I think 2) is a good risk-free optimization (though not sure how much that really makes up for).
For 1) it should be properly checked what the overhead for handling the cache instance for that variable is.

Also available in: Atom PDF