Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: PATCH: cleanup in fill_tile_sprite_array (PR#1016)
Home

[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]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev <freeciv-dev@xxxxxxxxxxx>, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: PATCH: cleanup in fill_tile_sprite_array (PR#1016)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 20 Oct 2001 09:56:00 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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)


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