1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-16 14:25:21 -05:00
pacman/lib/libalpm
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 po/: split into scripts/po/ and src/pacman/po/ 2011-06-23 22:50:01 -05:00
.gitignore Remove unnecessary entries from .gitignore files 2007-07-16 16:49:28 -04:00
add.c Allow fileconflict if unowned file moving into backup array 2011-07-14 15:34:04 -05:00
add.h Rename pmhandle_t to alpm_handle_t 2011-06-28 14:04:00 +10:00
alpm_list.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
alpm_list.h Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
alpm.c Prefix _alpm_errno_t members with ALPM 2011-07-02 02:01:39 +10:00
alpm.h Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
backup.c Allow fileconflict if unowned file moving into backup array 2011-07-14 15:34:04 -05:00
backup.h Allow fileconflict if unowned file moving into backup array 2011-07-14 15:34:04 -05:00
base64.c Add base64 algorithms from PolarSSL to libalpm 2011-03-23 02:22:00 -05:00
base64.h Add base64 algorithms from PolarSSL to libalpm 2011-03-23 02:22:00 -05:00
be_local.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
be_package.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
be_sync.c Clean up my debug logger mess 2011-07-19 00:23:42 -05:00
conflict.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
conflict.h Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
db.c Fix test suite when GPGME is disabled 2011-07-18 21:06:24 -05:00
db.h signing: move to new signing verification and return scheme 2011-07-05 10:13:20 -05:00
delta.c Prefix alpm_loglevel_t members with ALPM 2011-07-02 02:01:38 +10:00
delta.h Rename pmdelta_t to alpm_delta_t 2011-06-28 23:28:23 +10:00
deps.c Merge remote-tracking branch 'allan/ALPM' 2011-07-03 14:44:57 -05:00
deps.h Rename pmdepmissing_t to alpm_depmissing_t 2011-06-28 23:28:23 +10:00
diskspace.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
diskspace.h Rename pmhandle_t to alpm_handle_t 2011-06-28 14:04:00 +10:00
dload.c absorb fileinfo struct into dload_payload 2011-07-05 23:00:03 -04:00
dload.h absorb fileinfo struct into dload_payload 2011-07-05 23:00:03 -04:00
error.c signing: move to new signing verification and return scheme 2011-07-05 10:13:20 -05:00
graph.c Rename pmgraph_t to alpm_graph_t 2011-06-28 23:28:24 +10:00
graph.h Rename pmgraph_t to alpm_graph_t 2011-06-28 23:28:24 +10:00
group.c Rename internal functions with grp in their name 2011-06-29 15:52:33 +10:00
group.h Rename internal functions with grp in their name 2011-06-29 15:52:33 +10:00
handle.c Fix test suite when GPGME is disabled 2011-07-18 21:06:24 -05:00
handle.h signing: move to new signing verification and return scheme 2011-07-05 10:13:20 -05:00
log.c Prefix _alpm_errno_t members with ALPM 2011-07-02 02:01:39 +10:00
log.h Rename pmloglevel_t to alpm_loglevel_t 2011-06-28 23:28:24 +10:00
Makefile.am lib/rawstr: borrow raw string functions from curl 2011-07-05 17:18:23 -04:00
md5.c libalpm md5: use larger and dynamic buffer 2010-09-02 10:33:21 -05:00
md5.h libalpm/md5: Fix license header 2008-06-03 21:31:31 -05:00
package.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
package.h Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
pkghash.c Rename pmpkghash_t to alpm_pkghash_t 2011-06-28 23:28:24 +10:00
pkghash.h Rename pmpkghash_t to alpm_pkghash_t 2011-06-28 23:28:24 +10:00
rawstr.c include util.h in rawstr.c 2011-07-05 22:36:40 -05:00
remove.c Convert package filelists to an array instead of linked list 2011-07-21 15:04:30 -05:00
remove.h Unify package removal code 2011-07-06 09:26:09 -05:00
signing.c replace access() calls for debug info where applicable 2011-07-18 10:44:28 -05:00
signing.h signing: move to new signing verification and return scheme 2011-07-05 10:13:20 -05:00
sync.c absorb some _alpm_download params into payload struct 2011-07-05 23:00:02 -04:00
sync.h Rename pmhandle_t to alpm_handle_t 2011-06-28 14:04:00 +10:00
trans.c replace access() calls for debug info where applicable 2011-07-18 10:44:28 -05:00
trans.h Rename pmtransstate_t to alpm_transstate_t 2011-06-28 23:28:24 +10:00
util.c add _alpm_access() wrapper 2011-07-18 10:42:48 -05:00
util.h add _alpm_access() wrapper 2011-07-18 10:42:48 -05:00
version.c Style change: return(x) --> return x 2011-03-20 19:49:45 -05:00