After the upgrade, I noticed the GC running very frequently within seconds on subsequent identical calls that dont involve much of the system.
A quick cpu profile showed that 25% of my request processing time was spent in BrowscapXmlParser's regex function.
public bool IsCrawler(string userAgent)
{
return _crawlerUserAgentsRegexp.Any(p => Regex.IsMatch(userAgent, p));
}
To fix, I changed it to populate on load a thread safe cache object that can be checked per request. This eliminated this method from even being registered by the cpu profiler as worth of investgation which means it's likely around or below a 1/10th a percent of the request processing.
A significant improvement from 25%. This also fixed the frequent GC executions I was seeing.
https://github.com/nopSolutions/nopCommerce/pull/2181/commits/e6acb0215a2208ccc04ffe2d81dec7738a1ffc6b