Perf Problem Survey

time to read 1 min | 100 words

Rico Mariani has a survey about the cause of performance problems. Most of the perf problems I have run into are usually something like this:

Agency agency = Repository<Agency>.Load(15321);
Employee[] employees = agency.GetAllEmployees( Where.Employee.IsActive = true );
foreach(Employee emp in employees)
{
   if(emp.ShouldGetBonusForPeriod(DateUtil.GetPreviousMonthRange(DateTime.Today))
  {
      Console.WriteLine("Employee {0} should get a bonus.", emp.Name);      
  }   
}

Where Employee.ShouldGetBonusForPeriod() is calling the database.