Using favorites slows down server list
#1
This is a problem I found when started to use "favorite" and "hate" lists in servers menu. When I run AC without favorites, I have ~80 fps in server list. When I use favorites, I have only 30 fps.

I compiled Assault Cube with profiling information. I think this would be interesting for developers:

$ gprof ./bin_unix/linux_64_client | head
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total          
time   seconds   seconds    calls  ms/call  ms/call  name    
26.09      2.16     2.16 32713966     0.00     0.00  favcatcheckkey(serverinfo&, char const*)
11.59      3.12     0.96     2005     0.48     2.12  assignserverfavourites()
  6.88      3.69     0.57  4655301     0.00     0.00  render_flat(int, int, int, int, int, sqr*, sqr*, sqr*, sqr*, bool)
  5.56      4.15     0.46   634482     0.00     0.00  text_bounds(char const*, int&, int&, int)
  4.59      4.53     0.38     2197     0.17     0.73  render_seg_new(float, float, float, int, int, int, int, int)

As you see, favcatcheckkey is a very hungry function and it eats 1/3 of all CPU time decreasing fps. This function becomes a bottleneck on old PC's. I have an old Pentium 4 processor, newer machines just does not notice difference.

Best solution to not call favorites check every frame refresh.
Thanks given by:


Messages In This Thread
Using favorites slows down server list - by RPG - 09 Dec 12, 04:04PM