pacman/src/pacman
Dan McGee bb3dada871 Convert package filelists to an array instead of linked list
This accomplishes quite a few things with one rather invasive change.

1. Iteration is much more performant, due to a reduction in pointer
   chasing and linear item access.
2. Data structures are smaller- we no longer have the overhead of the
   linked list as the file struts are now laid out consecutively in
   memory.
3. Memory allocation has been massively reworked. Before, we would
   allocate three different pieces of memory per file item- the list
   struct, the file struct, and the copied filename. What this resulted
   in was massive fragmentation of memory when loading filelists since
   the memory allocator had to leave holes all over the place. The new
   situation here now removes the need for any list item allocation;
   allocates the file structs in contiguous memory (and reallocs as
   necessary), leaving only the strings as individually allocated. Tests
   using valgrind (massif) show some pretty significant memory
   reductions on the worst case `pacman -Ql > /dev/null` (366387 files
   on my machine):

   Before:
     Peak heap:   54,416,024 B
	 Useful heap: 36,840,692 B
	 Extra heap:  17,575,332 B

   After:
     Peak heap:   38,004,352 B
	 Useful heap: 28,101,347 B
	 Extra heap:   9,903,005 B

Several small helper methods have been introduced, including a list to
array conversion helper as well as a filelist merge sort that works
directly on arrays.

Signed-off-by: Dan McGee <dan@archlinux.org>
2011-07-21 15:04:30 -05:00
..
po src/pacman/po/: prune message catalog and translations 2011-06-23 22:55:56 -05:00
.gitignore Remove pacman.static build from build files 2008-07-15 19:05:24 -05:00
Makefile.am po/: split into scripts/po/ and src/pacman/po/ 2011-06-23 22:50:01 -05:00
callback.c pacman/callback: show .sig suffix on sig download 2011-07-18 21:01:12 -05:00
callback.h Rename pmtransprog_t to alpm_transprog_t 2011-06-28 23:28:24 +10:00
conf.c fix segfault if pacman.conf can't be read 2011-07-05 21:36:46 -05:00
conf.h signing: move to new signing verification and return scheme 2011-07-05 10:13:20 -05:00
database.c Make alpm_db_set_pkgreason() arguments more sane 2011-07-14 15:59:57 -05:00
deptest.c Rename pmdb_t to alpm_db_t 2011-06-28 14:16:12 +10:00
package.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
package.h Rename pmpkg_t to alpm_pkg_t 2011-06-28 23:26:39 +10:00
pacman.c Prefix alpm_transflag_t members with ALPM 2011-07-02 02:01:39 +10:00
pacman.h Make config parsing a two-part affair 2011-05-05 11:48:12 -05:00
query.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
remove.c Allow invalid sync DBs to be returned by the library 2011-07-05 10:13:20 -05:00
sync.c Rework -Si display logic 2011-07-05 21:38:32 -05:00
upgrade.c Allow invalid sync DBs to be returned by the library 2011-07-05 10:13:20 -05:00
util.c Remove most usages of strncmp() 2011-07-05 21:29:02 -05:00
util.h Allow invalid sync DBs to be returned by the library 2011-07-05 10:13:20 -05:00