While checking the queries being fired off to the db for #8688 I noticed that for many test pages I had a handful of queries SELECTing a specific CultureRecord, by culture.
Checking around the codebase, my assumption is that those are caused by calls to GetCultureByName. It would be trivial to add a layer of cache to prevent those. Same for GetCultureById. Moreover, the signals to manage eviction of that appear to be already in place, and used in the same manager.
My question to the community and especially (@sebastienros and @BenedekFarkas ) is: do you think this is worth it?
I don't have a chance right now to measure this.
https://github.com/OrchardCMS/Orchard/blob/bdba35c704bd07b431fae901f0376856c9a743c2/src/Orchard/Localization/Services/DefaultCultureManager.cs#L70
While checking the queries being fired off to the db for #8688 I noticed that for many test pages I had a handful of queries SELECTing a specific CultureRecord, by culture. Checking around the codebase, my assumption is that those are caused by calls to
GetCultureByName
. It would be trivial to add a layer of cache to prevent those. Same forGetCultureById
. Moreover, the signals to manage eviction of that appear to be already in place, and used in the same manager.My question to the community and especially (@sebastienros and @BenedekFarkas ) is: do you think this is worth it? I don't have a chance right now to measure this.