[Freeciv-Dev] Re: improper access of iterators
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, Aug 26, 2001 at 03:29:01PM -0400, Justin Moore wrote:
>
> In my quest to improve genlist efficiency I've stumbled across some
> improper use of variables within the AI and server code. Look at
> ai/aicity.c:1036. The unit_list_iterate is defined in terms of the
> TYPED_LIST_ITERATE macro in common/genlist.h. The current macro uses a
> genlist_iterator named myiter that the AI and server code references
> directly, even though the iterator isn't specifically initialized or even
> named within the calling code.
>
> What are people's thoughts about me migrating from the old genlist to
> my new genlist? My current version of genlist is backwards compatible
> with the old one. The implementation of the ITERATOR_* macros are kind of
> hacks and are probably slightly less efficient than the old ones, but I
> plan to phase those out if possible. My idea is to migrate code from the
> older, slower genlist data structures and iterators to the newer, faster
> ones. It would be in a few steps. If people would like more info on
> this, I'd be happy to provide it. I really think we could get a good
> performance gain out of a more efficient genlist, but I'd like some
> feedback on my ideas.
You have to show code or provide more details. Overall I think
dynamically resized arrays are faster then double linked lists. I
don't think there will be a lot of overall performance gain. I would
like to see an interface genlist.h and implementations like
array_genlist.h and dll_genlist.h. This would allow sufficient
performance testing.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"If at first you don't succeed... well so much for skydiving."
- [Freeciv-Dev] improper access of iterators, Justin Moore, 2001/08/26
- [Freeciv-Dev] Re: improper access of iterators,
Raimar Falke <=
- [Freeciv-Dev] Re: improper access of iterators, Justin Moore, 2001/08/26
- [Freeciv-Dev] Re: improper access of iterators, Raimar Falke, 2001/08/26
- [Freeciv-Dev] Re: improper access of iterators, Justin Moore, 2001/08/26
- [Freeciv-Dev] Re: improper access of iterators, Jason Dorje Short, 2001/08/26
- [Freeciv-Dev] Re: improper access of iterators, Raimar Falke, 2001/08/27
- [Freeciv-Dev] Re: improper access of iterators, Gaute B Strokkenes, 2001/08/27
|
|