Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] comparison of client speeds
Home

[Freeciv-Dev] comparison of client speeds

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv-Dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] comparison of client speeds
From: Jason Dorje Short <jdorje@xxxxxxxxxxxx>
Date: Mon, 11 Oct 2004 19:37:20 -0400

I applied the attached patch. I set the sliding time to 500 ms and tried it out. I ran it with iso-view with default resolution (except ftwl, which had to use non-iso view). I used different clients. I get something like this:

  gui-gtk-2.0: 12 FPS
  gui-gtk: 24 FPS
  gui-xaw: 28 FPS
  gui-ftwl/sdl: 6 FPS
  gui-ftwl/x11: 4 FPS

gui-gtk-2.0 is probably slower because of its implementation of flush_dirty. We use gtk's implementation of diry areas and pass control back to gtk to do the flushing. Aside from the added overhead this also gives gtk the opportunity to process any other pending events (good for responsiveness, bad for FPS).

With fullscreen instead of default resolution, these speeds are cut in half.

Using the store-pos patch (PR#9105) increases the speed by 25-50%.

jason
? fctest
? freeciv-2.0.0-beta1.tar.gz
Index: client/mapview_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/mapview_common.c,v
retrieving revision 1.151.2.3
diff -u -r1.151.2.3 mapview_common.c
--- client/mapview_common.c     9 Oct 2004 16:00:37 -0000       1.151.2.3
+++ client/mapview_common.c     11 Oct 2004 22:16:39 -0000
@@ -503,6 +503,7 @@
     int diff_x, diff_y;
     double timing_sec = (double)smooth_center_slide_msec / 1000.0, mytime;
     static struct timer *anim_timer;
+    int frames = 0;
 
     gui_distance_vector(&diff_x, &diff_y, start_x, start_y, gui_x0, gui_y0);
     anim_timer = renew_timer_start(anim_timer, TIMER_USER, TIMER_ACTIVE);
@@ -514,7 +515,12 @@
                              start_y + diff_y * (mytime / timing_sec));
       flush_dirty();
       gui_flush();
+      frames++;
     } while (mytime < timing_sec);
+
+    mytime = read_timer_seconds(anim_timer);
+    freelog(LOG_NORMAL, "Got %d frames in %f seconds; %f FPS.",
+           frames, mytime, (float)frames / mytime);
   } else {
     base_set_mapview_origin(gui_x0, gui_y0);
   }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] comparison of client speeds, Jason Dorje Short <=