simple performance question


I have seen, that the g_list_append in glib function always searches the
end of the list, since there is no pointer to the last element. And I have
seen, that a few programs uses this function to set up lists.

So, wouldn´t it be better to do a g_list_prepend and add the elements form
last to first?
(Or hold a reference to the last element)

I know this sounds rather stupid, since the most list are not very long,
and only initialized once. If performance is a problem, this could 
perhaps speed up a few things. 

Thought I could mention this. 

    _/         _/_/   _/      _/          Dirk Luetjens
   _/        _/      _/_/  _/_/           Lehrstuhl fuer Messtechnik
  _/        _/_/    _/  _/  _/            RWTH Aachen
 _/        _/      _/      _/             D-52056 Aachen
_/_/_/_/  _/      _/      _/              Germany

Institute for Measurement Techniques      phone: +49 241 80 78 65     
University of Technology Aachen           fax:           8888 200
                                          email: dirk@post.LfM.RWTH-Aachen.De

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]