• Yorick Peterse's avatar
    Improve ProjectTeam#max_member_access performance · 3025b711
    Yorick Peterse authored
    By comparing objects in Ruby we can greatly improve the performance of
    this method. In the worst case (should no data be eager loaded) this
    will run the same amount of queries as before, in the best case (when
    data _is_ eager loadeD) it requires no queries at all.
    
    The added benchmark used to produce around 273 iterations per second.
    With this commit this has been increased to almost 40 000 iterations per
    second: a speedup of roughly 145 times.
    
    Combined with eager loading Note associations this results in about 30
    queries less when viewing a single issue, this in turn cuts down the
    loading time by 30-40%.
    3025b711
project_team_spec.rb 559 Bytes