Problem/Motivation
The method mailsystem_get_classes is executed in hook_init. As it is executed in hook_init and it is expected to be mostly static, it is safe to move it to cache_bootstrap. Moving it there will allow further improvements of cache speeds through this back-port of D8 feature.
Some still open questions:
1. Is this method really needed on init?
2. Can we make it lazy on the first mail call?
Proposed resolution
Just move the bin used for the cache to the cache_bootstrap one.
Remaining tasks
Discussion, patch and the rest.
User interface changes
None.
API changes
None. Implementation detail - move the cache layer.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | mailsystem-move-to-cache_bootstrap-2708415-D7-2.patch | 1.47 KB | ndobromirov |
Comments
Comment #2
ndobromirov CreditAttribution: ndobromirov commentedUpdated title and description.
Here is a POC patch.
Comment #3
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedThanks for the patch and the issue @ndobromirov!
I believe this was already addressed on #1905544: Cache mailsystem_get_classes() between requests - which is now part of the latest release. Feel free to reopen if you feel otherwise.
Comment #4
ndobromirov CreditAttribution: ndobromirov commentedWell the issue is a bit different :). It's not about adding a cache layer, as there was one already, but moving it's storage to a more appropriate place - cache_bootstrap.
Comment #5
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedAh yes, you're right @ndobromirov - clearly went to fast here :)
Comment #6
Manuel Garcia CreditAttribution: Manuel Garcia as a volunteer and at Appnovation for Pfizer, Inc. commentedYou may want to see the discussion on #2558713: Mail system should not be using hook_init
Comment #7
ndobromirov CreditAttribution: ndobromirov commentedBecause the following 2 - I am closing this.
Comment #8
SocialNicheGuru CreditAttribution: SocialNicheGuru commented@ndobromirov can you site a source for the performance issue in D8?
Comment #9
ndobromirov CreditAttribution: ndobromirov commentedTwo examples showing proper internal issues in the ChainedFastBackend.
#2611400: ChainedFastBackend should not invalidate the whole fastBackend when doing a Set()
#2508417: ChainedFastBackend should have a centralized invalidation service