Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
August 2000: [Freeciv-Dev] server i/o patch |
[Freeciv-Dev] server i/o patch[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I've been running a couple of tests to see what's the main cause for server-->client network traffic in the game. The result of a couple of these tests is attached with this mail. (tested with default map size, generator 2, 4 AIs) In short, the tests show the main causes for network traffic are: PACKET_UNIT_INFO, PACKET_CITY_INFO and PACKET_TILE_INFO. The minimum size for the contents of each of these packets is: PACKET_UNIT_INFO: 2+4*1+2+11*1+2 = 21 bytes PACKET_CITY_INFO: 2+3*1+?+9*1+10*2+1+1+1 > 37 bytes PACKET_TILE_INFO: 3*1+2+1 = 6 bytes (add to the figures above 2 bytes for the length field, and another byte for the packet type field). Since the tile packets are already highly optimized (actually they aren't but the other two are MUCH worse), we should try to optimize the server to send less redundant unit & city data. Some things could be improved: === PACKET_UNIT_INFO: * maybe some things like upkeep could be calculated by the client to save sending that info? * some info doesn't change often (eg: homecity, upkeep, upkeep_food, upkeep_gold), or never changes (type). so shouldn't be always sent. * goto data is being always sent even if the unit isn't on goto mode. === PACKET_CITY_INFO: * again, some info doesn't change often (city name, trade data), or never changes (x, y). * not all data is required sometimes (eg: if you are receiving info on enemy cities not covered by FoW). Also attached is a newer version of the net patch that adds dynamic send buffers, and some other minor fixes. I didn't have the time to merge Lauri's latest changes yet. --- Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
test2.log.gz
test3.log.gz
freeciv-net-2.1.patch.gz
|