Free cookie consent management tool by TermsFeed Policy Generator

Opened 9 years ago

Closed 9 years ago

#2353 closed defect (obsolete)

Improve performance of Hive status page

Reported by: ascheibe Owned by: abeham
Priority: medium Milestone:
Component: Hive.Server Version: 3.3.11
Keywords: Cc:

Description


Change History (7)

comment:1 Changed 9 years ago by ascheibe

  • Status changed from new to accepted

comment:2 Changed 9 years ago by ascheibe

r12146

  • improved performance of status page
  • fixed code formatting and usings
  • simplified some expressions

comment:3 Changed 9 years ago by ascheibe

Loading time of the site under current load (2310 tasks in queue, 76 calculating) was in average 150 seconds before. Now it's somewhere around 1 or 2 seconds.

comment:4 Changed 9 years ago by ascheibe

  • Owner changed from ascheibe to abeham
  • Status changed from accepted to reviewing

comment:5 Changed 9 years ago by abeham

  • Owner changed from abeham to ascheibe
  • Status changed from reviewing to assigned

The performance improvements are quite impressive.

I see that you replaced some Count() > 0 calls with Any(), probably requiring you not to enumerate all entries. On the other hand I also see a couple of ToArray() calls which again would enumerate all entries. I'm not sure if those Any() calls were implemented to improve performance or just make the code clear. I am having difficulty identifying the exact points of the real improvements as there are many changes at once.

Some comments:

  • onlineSlaves or slaveStats for instance is trailed with a ToList() resp. ToArray() thus using Any() or Count() is only for clarity reasons. Also this seems redundant: onlineSlaves.Any() && onlineSlaves.Any(x => x.IsAllowedToCalculate) ? ... : ...
  • There's a HiveDao and an OptimizedHiveDao, both with their own interface. I assume both are in use, still I want to raise the question if we really need two Daos with two independent interfaces?

Thanks again for the performance improvement and investigation, much appreciated! It's only a small thing, but please consider removing the redundant condition. If you're in doubt how some LINQ method reacts to empty collections, I would recommend to fire up e.g. LINQPad and try it out. This is a neat little program for evaluating small bits of .NET code.

comment:6 Changed 9 years ago by ascheibe

  • Owner changed from ascheibe to abeham
  • Status changed from assigned to reviewing
  • The Any() calls were just added to make the code clearer; the main performance improvements come from using SQL instead of LINQ.
  • I have removed the onlineSlaves.Any() call in r12457.
  • Concerning HiveDao and OptimizedHiveDao: dglaser is currently working on the Hive Status page and we have also already discussed that this current structure is not optimal. dglaser will improve this in the course of his work on Hive. This also means that the current status page will be removed in the near future and replaced with the new one.

comment:7 Changed 9 years ago by ascheibe

  • Milestone HeuristicLab 3.3.12 deleted
  • Resolution set to obsolete
  • Status changed from reviewing to closed

Obsolete because of #2394.

Note: See TracTickets for help on using tickets.