janhebnes / startlist.club

Flight Log for flight clubs - created for handling flight log operations for soaring flight clubs in northern Europe.
https://startlist.club/about
MIT License
13 stars 10 forks source link

Issue for CPU (A lot of CPU or Memory is being consumed by `IEnumerable<T>....) #249

Open janhebnes opened 5 months ago

janhebnes commented 5 months ago

Description: A lot of CPU or Memory is being consumed by IEnumerable<T>.Aggregate() calls.

Current condition: 36% of your CPU was spent in Enumerable.Aggregate called from FlightJournal.Web.Controllers.ReportController.Export. We expected this value to be <1%.

Recommendations: Consider unrolling the LINQ expression to use an explicit for-loop.

In case of nested LINQ expressions, make sure that same computati...

Call Stack:

System.Core!System.Linq.Queryable.SingleOrDefault(class System.Linq.IQueryable1<!!0>,class System.Linq.Expressions.Expression1<class System.Func2<!!0,bool>>) flightjournal.web!FlightJournal.Web.Controllers.ClubController.GetCurrentClub(class System.Web.HttpContextBase,class System.Web.Routing.RouteData) flightjournal.web!FlightJournal.Web.Controllers.ClubController.GetCurrentClub() flightjournal.web!FlightJournal.Web.Models.Flight.IsCurrentClubPilots(class FlightJournal.Web.Models.Flight) flightjournal.web!FlightJournal.Web.Controllers.ReportController+<>c.<Export>b__2_2(class FlightJournal.Web.Models.Flight) System.Core!System.Linq.Enumerable.Aggregate(class System.Collections.Generic.IEnumerable1<!!0>,!!1,class Syste