summaryrefslogtreecommitdiff
path: root/check-racy.c
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-02-05 16:34:56 -0500
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-02-05 16:34:56 -0500
commit10831c551323121bdab06c3eaf2f52c6658fd6b8 (patch)
tree10b3dc24b257792a0097b5715162a6a40f598fa9 /check-racy.c
parentInclude checkpoint command in the BNF. (diff)
downloadtgif-10831c551323121bdab06c3eaf2f52c6658fd6b8.tar.xz
Reduce memory usage of fast-import.
Some structs are allocated rather frequently, but were using integer types which were far larger than required to actually store their full value range. As packfiles are limited to 4 GiB we don't need more than 32 bits to store the offset of an object within that packfile, an `unsigned long` on a 64 bit system is likely a 64 bit unsigned value. Saving 4 bytes per object on a 64 bit system can add up fast on any sizable import. As atom strings are strictly single components in a path name these are probably limited to just 255 bytes by the underlying OS. Going to that short of a string is probably too restrictive, but certainly `unsigned int` is far too large for their lengths. `unsigned short` is a reasonable limit. Modes within a tree really only need two bytes to store their whole value; using `unsigned int` here is vast overkill. Saving 4 bytes per file entry in an active branch can add up quickly on a project with a large number of files. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'check-racy.c')
0 files changed, 0 insertions, 0 deletions