I have been using T4MVC for quite a while now. I have a high traffic site that keeps growing every year and we have noticed some performance issues. We are using LeanSentry and we are seeing these type of CPU spikes with our T4MVC URL generation. Below is one high CPU userage snapshot with these codelines made available.
Is this a valid concern or something else?
Example of performance hit code generating URLS
protected virtual void PopulateScheduleGameLinks(List<ScheduleGroupDisplay<ScheduleGameDisplay>> gamesGroup)
{
gamesGroup.SelectMany(q => q.Games)
.ToList()
.ForEach(
q =>
{
foreach (var asset in q.Assets)
{
asset.Url = Helper.GetFilePath(asset.Url, asset.Version);
}
if (q.ExternalId != null)
{
long ticks;
if (long.TryParse(q.ExternalId, out ticks) &&
q.StatisticsType != StatisticsType.MyStatsOnline &&
q.StatisticsType != StatisticsType.ScorebookPlus &&
q.Assets.All(t => t.Type != GameAssetType.Scoresheet))
{
q.Assets.Add(new ScheduleGameAssetDisplay
{
Type = GameAssetType.Scoresheet,
Url = Url.Action(MVC.EventReports.GameStatistics(q.EventId, null, q.Id.ToString()).AddReportPdf().AddRouteValue(Config.QueryString.Version, ticks))
});
}
}
q.LiveGameLink = this.BuildScoreCastUrl(q.StatisticsType, q.ExternalId, null, q.Id, q.EventId, q.SportHost, q.EventName.GenerateSlug());
q.CalendarLink = Url.Action(MVC.Calendar.Game(q.Id));
});
}