aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/encoder_test.go
diff options
context:
space:
mode:
authorDavid Symonds <dsymonds@golang.org>2018-05-30 11:06:44 +1000
committerDavid Symonds <dsymonds@golang.org>2018-05-30 11:34:26 +1000
commitcf532f99e3e7632bc1d813245a4c79ae38b4d320 (patch)
tree702b13e6e462ca39fcfff119c1be949963f32705 /plumbing/format/packfile/encoder_test.go
parent57570e84f8c5739f0f4a59387493e590e709dde9 (diff)
downloadgo-git-cf532f99e3e7632bc1d813245a4c79ae38b4d320.tar.gz
packfile: improve Index memory representation to be more compact
Instead of using a map for offset indexing, use a sorted slice. Binary searching is fast, and a slice is much more compact. This has a negligible hit on speed, but has a significant impact on memory usage, especially for larger repos. benchmark old ns/op new ns/op delta BenchmarkIndexConstruction-12 15506506 14056098 -9.35% benchmark old allocs new allocs delta BenchmarkIndexConstruction-12 60764 60385 -0.62% benchmark old bytes new bytes delta BenchmarkIndexConstruction-12 4318145 3913169 -9.38% Signed-off-by: David Symonds <dsymonds@golang.org>
Diffstat (limited to 'plumbing/format/packfile/encoder_test.go')
0 files changed, 0 insertions, 0 deletions