| [Freeciv-Dev] Re: PATCH: cleanup in fill_tile_sprite_array (PR#1016)[Top] [All Lists][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
 
 On Fri, Oct 19, 2001 at 09:27:42PM -0400, Ross W. Wetmore wrote:
> 
> Why do you *always* go for the O(n) solution to any problem?
> Is this a conspiracy to slow down the codebase?
> 
> In this case do the computation once and stash it in an array.
> Then do an array lookup. 
> 
> If you put this where the enums are assigned, then you can even 
> define it statically with a note to make sure you change the two
> elements in tandem.
> 
> Every time you add one of the "little" inefficiencies you are 
> killing the performance. It may be the death of a thousand cuts, 
> but you seem to be very prolific at cutting, and the fixes will
> be a thousand fixes to recover.
Feel free to make a patch.
        Raimar
-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Of course, someone who knows more about this will correct me if I'm
  wrong, and someone who knows less will correct me if I'm right."
    -- David Palmer (palmer@xxxxxxxxxxxxxxxxxx)
 
 |  |