mirror of
https://github.com/restic/restic.git
synced 2026-11-22 13:24:24 +00:00
internal/restic: Don't allocate in Tree.Insert
name old time/op new time/op delta BuildTree-8 34.6µs ± 4% 7.0µs ± 3% -79.68% (p=0.000 n=18+19) name old alloc/op new alloc/op delta BuildTree-8 34.0kB ± 0% 0.9kB ± 0% -97.37% (p=0.000 n=20+20) name old allocs/op new allocs/op delta BuildTree-8 108 ± 0% 1 ± 0% -99.07% (p=0.000 n=20+20)
This commit is contained in:
1 parent
78dac2fd48
commit
c892c0bab9
6 files changed
+35
-11
No files matched your search
@@ -23,7 +23,7 @@ func BuildTreeMap(tree TestTree) (m TreeMap, root restic.ID) {
|
||||
}
|
||||
|
||||
func buildTreeMap(tree TestTree, m TreeMap) restic.ID {
|
||||
res := restic.NewTree()
|
||||
res := restic.NewTree(0)
|
||||
|
||||
for name, item := range tree {
|
||||
switch elem := item.(type) {
|
||||
|
||||
Reference in new issue
Block a user