mirror of
https://github.com/octoleo/restic.git
synced 2024-06-03 01:20:49 +00:00
df2c03a6a4
When looking up a blob in the master index, with several indexes present in the master index, a significant amount of time is spent generating errors for each failed lookup. However, these errors are often used to check if a blob is present, but the contents are not inspected making the overhead of the error not useful. Instead, change Index.Lookup (and Index.LookupSize) to instead return a boolean denoting if the blob was found instead of an error. Also change all the calls to these functions to handle the new function signature. benchmark old ns/op new ns/op delta BenchmarkMasterIndexLookupSingleIndex-6 820 897 +9.39% BenchmarkMasterIndexLookupMultipleIndex-6 12821 2001 -84.39% BenchmarkMasterIndexLookupSingleIndexUnknown-6 5378 492 -90.85% BenchmarkMasterIndexLookupMultipleIndexUnknown-6 17026 1649 -90.31% benchmark old allocs new allocs delta BenchmarkMasterIndexLookupSingleIndex-6 9 9 +0.00% BenchmarkMasterIndexLookupMultipleIndex-6 59 19 -67.80% BenchmarkMasterIndexLookupSingleIndexUnknown-6 22 6 -72.73% BenchmarkMasterIndexLookupMultipleIndexUnknown-6 72 16 -77.78% benchmark old bytes new bytes delta BenchmarkMasterIndexLookupSingleIndex-6 160 160 +0.00% BenchmarkMasterIndexLookupMultipleIndex-6 3200 240 -92.50% BenchmarkMasterIndexLookupSingleIndexUnknown-6 1232 48 -96.10% BenchmarkMasterIndexLookupMultipleIndexUnknown-6 4272 128 -97.00% |
||
---|---|---|
.. | ||
testdata | ||
.gitignore | ||
background_linux.go | ||
background.go | ||
cleanup.go | ||
cmd_backup.go | ||
cmd_cat.go | ||
cmd_check.go | ||
cmd_debug.go | ||
cmd_diff.go | ||
cmd_dump.go | ||
cmd_find.go | ||
cmd_forget.go | ||
cmd_generate.go | ||
cmd_init.go | ||
cmd_key.go | ||
cmd_list.go | ||
cmd_ls.go | ||
cmd_migrate.go | ||
cmd_mount.go | ||
cmd_options.go | ||
cmd_prune.go | ||
cmd_rebuild_index.go | ||
cmd_restore.go | ||
cmd_snapshots.go | ||
cmd_tag.go | ||
cmd_unlock.go | ||
cmd_version.go | ||
doc.go | ||
exclude_test.go | ||
exclude.go | ||
excludes | ||
find.go | ||
flags_test.go | ||
format.go | ||
global_debug.go | ||
global_release.go | ||
global.go | ||
integration_fuse_test.go | ||
integration_helpers_test.go | ||
integration_helpers_unix_test.go | ||
integration_helpers_windows_test.go | ||
integration_test.go | ||
local_layout_test.go | ||
lock.go | ||
main.go | ||
table.go |