Data Structures

Richard Laager rlaager at wiktel.com
Tue Nov 19 00:24:25 EST 2013


I don't know that I can speak to things that need optimizing, but you'll
find a variety of data structures in Pidgin. Of course, this is all
about the *use* of them, as the actual implementations are provided by
glib.

A few things that jump to my mind:

- Check out libpurple/stringref.[ch] for an interesting data structure
not provided by glib.

- We use lots of linked lists, both single- and double-linked.

- The buddy list (libpurple/blist.[ch]) is a tree.

- The logging code also has some hash table stuff going on with "log
sets", which are used to populate autocomplete lists. There are other
areas that use hash tables; this is just one I'm familiar with.

- This may not be as relevant any more, but at the time this change was
implemented, the logging code benefited a lot from switching to glib's
slice allocator. (Though that's maybe not directly a "data structures"
thing.) It also benefited slightly from avoiding zero'ing the allocated
structs; that's probably not even noticable these days.

-- 
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://pidgin.im/pipermail/devel/attachments/20131118/5726a863/attachment.sig>


More information about the Devel mailing list