Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] [Patch] Eliminating player id arguments
Home

[Freeciv-Dev] [Patch] Eliminating player id arguments

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [Patch] Eliminating player id arguments
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Aug 2001 20:07:21 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

This rather large patch kills the hopefully last instances of
playerids in public interfaces. The replacements are obvious correct
(TM). In some of the methods the result value of a *_owner call can be
cached. I haven't done this for clarify reasons.

If there are no objections I will apply this patch.

As for the performance (an autogame run till 1969):

  0.81    353.77     4.82 137960745     0.00     0.00  city_owner
  0.43    479.24     2.53 55512576     0.00     0.00  unit_owner

-----------------------------------------------
                0.00    0.00       4/137960745     city_populate [268]
                0.00    0.00       6/137960745     found_new_tech [422]
                0.00    0.00       7/137960745     
reestablish_city_trade_routes [682]
                0.00    0.00       7/137960745     
send_global_city_turn_notifications [666]
                0.00    0.00      10/137960745     handle_unit_establish_trade 
[623]
                0.00    0.00      17/137960745     remove_city [528]
                0.00    0.00      17/137960745     game_remove_city [732]
                0.00    0.00      19/137960745     transfer_unit [627]
                0.00    0.00      19/137960745     check_pollution [722]
                0.00    0.00      25/137960745     city_reduce_size [793]
                0.00    0.00      36/137960745     establish_trade_route [702]
                0.00    0.00      50/137960745     do_unit_disband_safe [691]
                0.00    0.00      53/137960745     do_apollo_program [139]
                0.00    0.00      90/137960745     raze_city [681]
                0.00    0.00     102/137960745     transfer_city <cycle 1> [291]
                0.00    0.00     102/137960745     map_unfog_city_area [529]
                0.00    0.00     110/137960745     city_auto_remove_worker [403]
                0.00    0.00     112/137960745     building_lost [790]
                0.00    0.00     116/137960745     ai_city_choose_build [188]
                0.00    0.00     136/137960745     ai_do_build_city [328]
                0.00    0.00     525/137960745     really_show_area [245]
                0.00    0.00     708/137960745     try_summon_barbarians [475]
                0.00    0.00     773/137960745     advisor_choose_build [466]
                0.00    0.00    1723/137960745     is_allied_city_tile [713]
                0.00    0.00    1869/137960745     
really_give_tile_info_from_player_to_player [436]
                0.00    0.00    2046/137960745     is_non_attack_city_tile [744]
                0.00    0.00    2061/137960745     server_remove_unit [299]
                0.00    0.00    3878/137960745     create_unit_full [290]
                0.00    0.00    4305/137960745     city_increase_size [273]
                0.00    0.00    5941/137960745     
remove_obsolete_buildings_city [431]
                0.00    0.00    7889/137960745     
can_unit_move_to_tile_with_reason [339]
                0.00    0.00    8633/137960745     handle_unit_enter_city 
<cycle 1> [453]
                0.00    0.00    9339/137960745     handle_unit_move_request [49]
                0.00    0.00   16503/137960745     kill_something_with [11]
                0.00    0.00   19696/137960745     upgrade_unit_prod [547]
                0.00    0.00   21532/137960745     ai_advisor_choose_building 
[205]
                0.00    0.00   27308/137960745     ai_scientists_taxmen [68]
                0.00    0.00   36279/137960745     ai_manage_taxes [17]
                0.00    0.00   36310/137960745     contemplate_new_city [26]
                0.00    0.00   36310/137960745     
contemplate_terrain_improvements [18]
                0.00    0.00   36310/137960745     ai_eval_buildings [65]
                0.00    0.00   36334/137960745     assess_danger [31]
                0.00    0.00   36553/137960745     
initialize_infrastructure_cache [61]
                0.00    0.00   36625/137960745     broadcast_city_info [295]
                0.00    0.00   37870/137960745     really_unfog_area [216]
                0.00    0.00   49094/137960745     get_colosseum_power [610]
                0.00    0.00   49676/137960745     is_enemy_city_tile [415]
                0.00    0.00   68878/137960745     city_incite_cost [346]
                0.00    0.00   72367/137960745     check_cities [174]
                0.00    0.00   75770/137960745     get_cathedral_power [548]
                0.00    0.00   88535/137960745     really_generate_warmap [13]
                0.00    0.00   93848/137960745     send_city_info_at_tile [221]
                0.00    0.00  112031/137960745     ai_sell_obsolete_buildings 
[305]
                0.01    0.00  163899/137960745     built_elsewhere [301]
                0.01    0.00  209858/137960745     check_units [353]
                0.01    0.00  239875/137960745     can_build_improvement [404]
                0.01    0.00  243107/137960745     is_non_allied_city_tile [281]
                0.01    0.00  248664/137960745     process_attacker_want [191]
                0.01    0.00  264083/137960745     send_city_info [198]
                0.01    0.00  307810/137960745     mark_improvement [427]
                0.01    0.00  349750/137960745     get_temple_power [330]
                0.02    0.00  596850/137960745     is_building_other_wonder 
[220]
                0.03    0.00  718440/137960745     citizen_happy_size [309]
                0.03    0.00  718440/137960745     set_pollution [84]
                0.04    0.00 1062279/137960745     city_get_food_tile [32]
                0.05    0.00 1436880/137960745     city_corruption [92]
                0.05    0.00 1570725/137960745     city_can_work_tile [259]
                0.14    0.00 4040143/137960745     
can_eventually_build_improvement [172]
                0.50    0.00 14205235/137960745     city_tile_value [19]
                0.68    0.00 19411880/137960745     city_affected_by_wonder [41]
                0.70    0.00 20156011/137960745     can_build_unit [33]
                1.09    0.00 31123948/137960745     set_tax_income [162]
                1.39    0.00 39854311/137960745     can_build_unit_direct [54]
[130]    0.8    4.82    0.00 137960745         city_owner [130]
-----------------------------------------------

-----------------------------------------------
                0.00    0.00       1/55512576     hut_get_barbarians [736]
                0.00    0.00       2/55512576     hut_get_city [630]
                0.00    0.00      10/55512576     teleport_unit_to_city <cycle 
1> [890]
                0.00    0.00      10/55512576     hut_get_tech [560]
                0.00    0.00      15/55512576     hut_get_mercenaries [631]
                0.00    0.00      19/55512576     hut_get_gold [830]
                0.00    0.00      19/55512576     transfer_unit [627]
                0.00    0.00      47/55512576     unit_enter_hut [536]
                0.00    0.00      56/55512576     wipe_unit_spec_safe [298]
                0.00    0.00      75/55512576     upgrade_unit [632]
                0.00    0.00      98/55512576     transfer_city_units [539]
                0.00    0.00     241/55512576     maybe_make_veteran [727]
                0.00    0.00     269/55512576     ai_military_findvictim [109]
                0.00    0.00     309/55512576     is_my_turn [516]
                0.00    0.00     339/55512576     resolve_unit_stack <cycle 1> 
[693]
                0.00    0.00     444/55512576     could_unit_move_to_tile [644]
                0.00    0.00     557/55512576     stay_and_defend_city [390]
                0.00    0.00     595/55512576     try_move_unit [446]
                0.00    0.00     871/55512576     advance_unit_focus [578]
                0.00    0.00    1125/55512576     find_nearest_friendly_port 
[286]
                0.00    0.00    1802/55512576     remove_unit_sight_points [473]
                0.00    0.00    2314/55512576     ai_gothere [184]
                0.00    0.00    2918/55512576     unit_move_turns [376]
                0.00    0.00    3542/55512576     city_support [166]
                0.00    0.00    3604/55512576     game_remove_unit [553]
                0.00    0.00    5582/55512576     kill_unit [359]
                0.00    0.00    5760/55512576     ai_manage_explorer [53]
                0.00    0.00    8526/55512576     handle_unit_enter_city <cycle 
1> [453]
                0.00    0.00    9668/55512576     handle_unit_attack_request 
[315]
                0.00    0.00   15625/55512576     assign_units_to_transporter 
[483]
                0.00    0.00   18523/55512576     is_non_attack_unit_tile [550]
                0.00    0.00   24726/55512576     can_unit_attack_unit_at_tile 
[534]
                0.00    0.00   25368/55512576     get_attacker [447]
                0.00    0.00   25590/55512576     unit_can_be_retired [614]
                0.00    0.00   39186/55512576     evaluate_city_building [24]
                0.00    0.00   39186/55512576     evaluate_improvements [16]
                0.00    0.00   58971/55512576     really_generate_warmap [13]
                0.00    0.00   59616/55512576     can_unit_move_to_tile [327]
                0.00    0.00   63492/55512576     update_unit_activity [249]
                0.00    0.00   73457/55512576     handle_unit_move_consequences 
<cycle 1> [74]
                0.00    0.00   74609/55512576     unit_move_rate [349]
                0.00    0.00   78372/55512576     unit_food_upkeep [492]
                0.00    0.00   82208/55512576     do_unit_goto [34]
                0.01    0.00  124058/55512576     check_cities [174]
                0.01    0.00  125461/55512576     check_units [353]
                0.01    0.00  167154/55512576     is_ground_threat [480]
                0.01    0.00  199106/55512576     handle_unit_move_request [49]
                0.01    0.00  225152/55512576     is_allied_unit_tile [310]
                0.02    0.00  383063/55512576     is_enemy_unit_tile [265]
                0.02    0.00  420105/55512576     can_unit_do_activity_targeted 
[351]
                0.02    0.00  479793/55512576     find_a_direction [242]
                0.02    0.00  507899/55512576     find_beachhead [196]
                0.04    0.00  905426/55512576     
ground_unit_transporter_capacity [147]
                0.04    0.00  956814/55512576     wakeup_neighbor_sentries [182]
                0.07    0.00 1555119/55512576     tile_is_accessible [134]
                0.09    0.00 2023379/55512576     goto_zoc_ok [115]
                0.18    0.00 3939097/55512576     enemies_at [209]
                0.18    0.00 3966007/55512576     is_non_allied_unit_tile [114]
                0.34    0.00 7405011/55512576     goto_is_sane [75]
                0.60    0.00 13147512/55512576     get_defender [29]
                0.83    0.00 18254673/55512576     find_the_shortest_path [51]
[171]    0.4    2.53    0.00 55512576         unit_owner [171]
-----------------------------------------------


-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Like the ad says, at 300 dpi you can tell she's wearing a
  swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you
  can tell it's painted on. I suppose at 2400 dpi you can tell
  if the paint is giving her a rash."
    -- Joshua R. Poulson

Attachment: playerid_cleanup1.diff.gz
Description: GNU Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [Patch] Eliminating player id arguments, Raimar Falke <=