(n, d int)
| 2038 | } |
| 2039 | |
| 2040 | func genDeepFiles(n, d int) []protocol.FileInfo { |
| 2041 | mrand.Seed(int64(n)) |
| 2042 | files := make([]protocol.FileInfo, n) |
| 2043 | t := time.Now().Unix() |
| 2044 | for i := 0; i < n; i++ { |
| 2045 | path := "" |
| 2046 | for i := 0; i <= d; i++ { |
| 2047 | path = filepath.Join(path, strconv.Itoa(mrand.Int())) |
| 2048 | } |
| 2049 | |
| 2050 | sofar := "" |
| 2051 | for _, path := range filepath.SplitList(path) { |
| 2052 | sofar = filepath.Join(sofar, path) |
| 2053 | files[i] = protocol.FileInfo{ |
| 2054 | Name: sofar, |
| 2055 | } |
| 2056 | i++ |
| 2057 | } |
| 2058 | |
| 2059 | files[i].ModifiedS = t |
| 2060 | files[i].Blocks = []protocol.BlockInfo{{Offset: 0, Size: 100, Hash: []byte("some hash bytes")}} |
| 2061 | } |
| 2062 | |
| 2063 | return files |
| 2064 | } |
| 2065 | |
| 2066 | func BenchmarkTree_10000_50(b *testing.B) { |
| 2067 | benchmarkTree(b, 10000, 50) |
no test coverage detected