Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: Notes and serial numbers
Home

[Freeciv-Dev] Re: Notes and serial numbers

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Notes and serial numbers
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Sep 2001 09:29:15 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Mon, Sep 03, 2001 at 12:50:19AM +0200, Raimar Falke wrote:
> On Sun, Sep 02, 2001 at 03:18:45PM -0700, Trent Piepho wrote:
> > On Sun, 2 Sep 2001, Raimar Falke wrote:
> > > 
> > > Proposal: remove categories and split the remaining two problems. For
> > > client side ai only the solution to the first problem is
> > > necessary. This will consists of two serial numbers (each 2 bytes
> > > wide) to each packet and an empty packet (type (1 byte)+size (2
> > > bytes)+2*sno(2 bytes)=7 bytes) after the server finishes processing a
> > > client packet. If nobody objects on the general idea I will extract
> > > the serial number stuff from the big note patch and post it here.
> > 
> > So your goal here is to make certain that modem players can never run a 
> > server
> > and will have a bigger disadvantage whenever they try to play with other
> > people?
> 
> Making some crude measurements: on a simple game till -3000 the server
> sents 2150 packets totaling 144759 bytes. The client sents 30 packets
> with 461 bytes. This are about 65 bytes per packet. Extra bytes for
> sno are: (2150+30)*4+30*7=8930. This would be an increase of 6.1%
> ((144759+461+8930)/(144759+461) of the total amount. Ok there is an
> increase. The question is: is this increase tolerable? Can the same be
> achieved with other means?

I made some more testing with my current patch. The average packet
size is even lower:

2: 17000 packets
2:   [ 1]:      1 packets;       83 bytes total;    83 bytes/packet average
2:   [ 3]:   5478 packets;   180774 bytes total;    33 bytes/packet average
2:   [ 6]:      5 packets;       75 bytes total;    15 bytes/packet average
2:   [ 7]:   9321 packets;   121173 bytes total;    13 bytes/packet average
2:   [11]:     36 packets;    40090 bytes total;  1113 bytes/packet average
2:   [12]:      6 packets;     3990 bytes total;   665 bytes/packet average
2:   [13]:      1 packets;       10 bytes total;    10 bytes/packet average
2:   [14]:    167 packets;     8340 bytes total;    49 bytes/packet average
2:   [15]:    825 packets;   110154 bytes total;   133 bytes/packet average
2:   [31]:     13 packets;      143 bytes total;    11 bytes/packet average
2:   [34]:      3 packets;       42 bytes total;    14 bytes/packet average
2:   [38]:      1 packets;       11 bytes total;    11 bytes/packet average
2:   [50]:      5 packets;       35 bytes total;     7 bytes/packet average
2:   [60]:     89 packets;     2276 bytes total;    25 bytes/packet average
2:   [61]:     52 packets;     8387 bytes total;   161 bytes/packet average
2:   [62]:     68 packets;    15062 bytes total;   221 bytes/packet average
2:   [64]:      5 packets;      225 bytes total;    45 bytes/packet average
2:   [67]:     12 packets;     1993 bytes total;   166 bytes/packet average
2:   [68]:      1 packets;      454 bytes total;   454 bytes/packet average
2:   [69]:      6 packets;     7059 bytes total;  1176 bytes/packet average
2:   [70]:     80 packets;     2541 bytes total;    31 bytes/packet average
2:   [71]:      1 packets;       27 bytes total;    27 bytes/packet average
2:   [74]:     62 packets;     7304 bytes total;   117 bytes/packet average
2:   [76]:      5 packets;      186 bytes total;    37 bytes/packet average
2:   [80]:      1 packets;       17 bytes total;    17 bytes/packet average
2:   [81]:      2 packets;      176 bytes total;    88 bytes/packet average
2:   [82]:    329 packets;     7193 bytes total;    21 bytes/packet average
2:   [86]:    161 packets;     1127 bytes total;     7 bytes/packet average
2:   [91]:    263 packets;     1841 bytes total;     7 bytes/packet average
2: average size per packet 30 bytes

The average size without sno would be 30-4=26 bytes/packet. This is an
increase of 15.4%. BAD. I have some ideas how to reduce this.

This whole instrumentation also allows to time certain requests:
 invalid move: 0.5ms
 valid move: 40ms
 disbanding a unit: 25ms
 clicking on city minimap: 300ms
 changing the production of a city: 450ms
 selling a building: 500ms
 changing current research: 40ms
 changing the research goal: 80ms
 changing tax rate: 220ms (this is very odd, a global tax rate change
   includes a recalculation of all 51 cities, however such a city
   recalculation costs at least 300ms for ONE city)
 pong packet: 0.5ms
 selling 7 buildings at once: the first request is finished after
   400ms the last after 900ms
 changing the production in all 51 cities: first request is finished
 after 800ms the last after 5700ms (== 5.7 seconds !!!)

All this times are are differ a little but the big picture should be
clear. The time mention above include:
 - client sends the packet
 - packet goes over the wire from client to server
 - server process request
 - server sends packets
 - packets goes over the wire from server to client
 - client processes all packets (GUI updates)

The time stops after the last packet which belongs to the original
request got processed.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
    1) Customers cause problems.
    2) Marketing is trying to create more customers.
  Therefore:
    3) Marketing is evil.


[Prev in Thread] Current Thread [Next in Thread]