Be more intelligent about storing file user and group names
authorPanu Matilainen <pmatilai@redhat.com>
Wed, 19 Nov 2008 16:17:56 +0000 (18:17 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 19 Nov 2008 16:17:56 +0000 (18:17 +0200)
commitf90f2f10155ebb010b3ff3119be31fd8600c1cb8
treecc18da501c5449a10beb501d909452780b24bc6d
parent6fd987b7291fb1306297c193f4ab01bf6cd02618
Be more intelligent about storing file user and group names
- User and group names contain an enormous amount of redundancy: typically
  most files and directories are owned by root:root. Store the each unique
  name just once into global cache and store indexes to the cache into
  rpmfi user + group arrays. This saves several megabytes of memory on
  a transaction of non-trivial size...
- The cache implementation is dumb, but it's not noticeably slower than
  uncached version, copying megs of strings around is not cheap either.
  Easy enough to replace with a hash-table or such if performace becomes
  and issue...
lib/rpmfi.c
lib/rpmfi_internal.h