-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Multi get implementation in QueryCache #5831
Conversation
d513550
to
06f8294
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and it's a freaking awesome improvement.
Just think that we can do some small refactoring do organise the code a bit more.
foreach ($entry->result as $index => $concreteEntry) { | ||
$entityCacheKeys[$index] = new EntityCacheKey($cm->rootEntityName, $concreteEntry['identifier']); | ||
} | ||
$entries = $region->getMultiple(new CollectionCacheEntry($entityCacheKeys)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ocramius does it makes sense to extract this process to a named constructor on CollectionCacheEntry
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checked...
In order to do that we would need make CollectionCacheEntry
know about EntityCacheKey
and now it just depends on CacheKey
(abstract class), so it's better keep the dependency here.
|
||
if ($this->cacheLogger !== null) { | ||
$this->cacheLogger->entityCacheMiss($regionName, $entityKey); | ||
$this->cacheLogger->entityCacheMiss($regionName, $entityCacheKeys[$index]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also do something CollectionCacheEntry#get($index)
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just use CollectionCacheEntry#identifiers
Hi
There is significant performance degradation when doctrine tries to check the cache (memcache) after fetching multiple thousands of rows. It occurs because it doesn't use memcache's multiple get function.
This modification implements multiple get cache checking as it has been done here: #954