History

object-access experiment with brand new radicle link Sync ODB

It's undoubtedly super fast especially for being sync, just neglectably slower than a simple shared reference, amazing, AND faster than a shared reference though an Arc.

Sebastian Thiel committed 4 years ago

Commit 7eb41681 parent 3bc90943 files · +658 −81Browse files

Unified · Split

3 files
  1. Cargo.lock +582 −79
  2. experiments/object-access/Cargo.toml +5 −1
  3. experiments/object-access/src/main.rs +71 −1
Cargo.lock+582−79
@@ -34,6 +34,12 @@ version = "1.0.47" · 33 unmodified lines
34source = "registry+https://github.com/rust-lang/crates.io-index"34source = "registry+https://github.com/rust-lang/crates.io-index"
35checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e"35checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e"
36 36
37[[package]]
38name = "arc-swap"
39version = "1.5.0"
40source = "registry+https://github.com/rust-lang/crates.io-index"
41checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f"
42
37[[package]]43[[package]]
38name = "argh"44name = "argh"
39version = "0.1.6"45version = "0.1.6"
@@ -168,6 +174,23 @@ dependencies = [ · 128 unmodified lines
168 "futures-lite",174 "futures-lite",
169]175]
170 176
177[[package]]
178name = "async-process"
179version = "1.3.0"
180source = "registry+https://github.com/rust-lang/crates.io-index"
181checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6"
182dependencies = [
183 "async-io",
184 "blocking",
185 "cfg-if",
186 "event-listener",
187 "futures-lite",
188 "libc",
189 "once_cell",
190 "signal-hook",
191 "winapi",
192]
193
171[[package]]194[[package]]
172name = "async-std"195name = "async-std"
173version = "1.10.0"196version = "1.10.0"
@@ -248,6 +271,15 @@ version = "1.3.2" · 74 unmodified lines
248source = "registry+https://github.com/rust-lang/crates.io-index"271source = "registry+https://github.com/rust-lang/crates.io-index"
249checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"272checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
250 273
274[[package]]
275name = "bitmaps"
276version = "2.1.0"
277source = "registry+https://github.com/rust-lang/crates.io-index"
278checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
279dependencies = [
280 "typenum",
281]
282
251[[package]]283[[package]]
252name = "block-buffer"284name = "block-buffer"
253version = "0.9.0"285version = "0.9.0"
@@ -361,7 +393,7 @@ dependencies = [ · 107 unmodified lines
361 "crates-index",393 "crates-index",
362 "env_logger",394 "env_logger",
363 "git-conventional",395 "git-conventional",
364 "git-repository",396 "git-repository 0.13.0",
365 "git-testtools",397 "git-testtools",
366 "insta",398 "insta",
367 "log",399 "log",
@@ -815,7 +847,7 @@ name = "diffing" · 447 unmodified lines
815version = "0.1.0"847version = "0.1.0"
816dependencies = [848dependencies = [
817 "anyhow",849 "anyhow",
818 "git-repository",850 "git-repository 0.13.0",
819 "git2",851 "git2",
820 "memory-lru",852 "memory-lru",
821 "rayon",853 "rayon",
@@ -983,12 +1015,48 @@ dependencies = [ · 161 unmodified lines
983 "waker-fn",1015 "waker-fn",
984]1016]
985 1017
1018[[package]]
1019name = "futures-macro"
1020version = "0.3.17"
1021source = "registry+https://github.com/rust-lang/crates.io-index"
1022checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb"
1023dependencies = [
1024 "autocfg",
1025 "proc-macro-hack",
1026 "proc-macro2",
1027 "quote",
1028 "syn",
1029]
1030
986[[package]]1031[[package]]
987name = "futures-sink"1032name = "futures-sink"
988version = "0.3.17"1033version = "0.3.17"
989source = "registry+https://github.com/rust-lang/crates.io-index"1034source = "registry+https://github.com/rust-lang/crates.io-index"
990checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"1035checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
991 1036
1037[[package]]
1038name = "futures-task"
1039version = "0.3.18"
1040source = "registry+https://github.com/rust-lang/crates.io-index"
1041checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12"
1042
1043[[package]]
1044name = "futures-util"
1045version = "0.3.17"
1046source = "registry+https://github.com/rust-lang/crates.io-index"
1047checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
1048dependencies = [
1049 "autocfg",
1050 "futures-core",
1051 "futures-macro",
1052 "futures-task",
1053 "pin-project-lite",
1054 "pin-utils",
1055 "proc-macro-hack",
1056 "proc-macro-nested",
1057 "slab",
1058]
1059
992[[package]]1060[[package]]
993name = "generic-array"1061name = "generic-array"
994version = "0.14.4"1062version = "0.14.4"
@@ -1025,7 +1093,7 @@ version = "0.7.0" · 30 unmodified lines
1025dependencies = [1093dependencies = [
1026 "bstr",1094 "bstr",
1027 "btoi",1095 "btoi",
1028 "git-features",1096 "git-features 0.18.0",
1029 "git-testtools",1097 "git-testtools",
1030 "itoa",1098 "itoa",
1031 "nom",1099 "nom",
@@ -1034,6 +1102,20 @@ dependencies = [ · 2 unmodified lines
1034 "serde",1102 "serde",
1035]1103]
1036 1104
1105[[package]]
1106name = "git-actor"
1107version = "0.7.0"
1108source = "registry+https://github.com/rust-lang/crates.io-index"
1109checksum = "5f14e997873247d4c4f496aa63d5dc6894245ec3778618a41342ef7ad5b63456"
1110dependencies = [
1111 "bstr",
1112 "btoi",
1113 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1114 "itoa",
1115 "nom",
1116 "quick-error",
1117]
1118
1037[[package]]1119[[package]]
1038name = "git-commitgraph"1120name = "git-commitgraph"
1039version = "0.7.0"1121version = "0.7.0"
@@ -1041,8 +1123,8 @@ dependencies = [ · 1 unmodified line
1041 "bstr",1123 "bstr",
1042 "byteorder",1124 "byteorder",
1043 "filebuffer",1125 "filebuffer",
1044 "git-features",1126 "git-features 0.18.0",
1045 "git-hash",1127 "git-hash 0.8.0",
1046 "git-testtools",1128 "git-testtools",
1047 "serde",1129 "serde",
1048 "thiserror",1130 "thiserror",
@@ -1062,6 +1144,17 @@ dependencies = [ · 13 unmodified lines
1062 "tempfile",1144 "tempfile",
1063]1145]
1064 1146
1147[[package]]
1148name = "git-config"
1149version = "0.1.9"
1150source = "registry+https://github.com/rust-lang/crates.io-index"
1151checksum = "5e3d08dabb27607a8bfd1a3c7d5c8aabc83a0e119dee6b8ae8876c1f68cd7dc7"
1152dependencies = [
1153 "dirs",
1154 "memchr",
1155 "nom",
1156]
1157
1065[[package]]1158[[package]]
1066name = "git-conventional"1159name = "git-conventional"
1067version = "0.10.3"1160version = "0.10.3"
@@ -1077,11 +1170,22 @@ dependencies = [ · 9 unmodified lines
1077name = "git-diff"1170name = "git-diff"
1078version = "0.12.0"1171version = "0.12.0"
1079dependencies = [1172dependencies = [
1080 "git-hash",1173 "git-hash 0.8.0",
1081 "git-object",1174 "git-object 0.16.0",
1082 "git-odb",1175 "git-odb 0.25.0",
1083 "git-testtools",1176 "git-testtools",
1084 "git-traverse",1177 "git-traverse 0.11.0",
1178 "quick-error",
1179]
1180
1181[[package]]
1182name = "git-diff"
1183version = "0.12.0"
1184source = "registry+https://github.com/rust-lang/crates.io-index"
1185checksum = "e6dc5ee60f47ea1d35aa4c79cbf338cdf4b91c9a03ad0dadd1f66bfdfaa57d61"
1186dependencies = [
1187 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1188 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1085 "quick-error",1189 "quick-error",
1086]1190]
1087 1191
@@ -1094,7 +1198,7 @@ dependencies = [ · 6 unmodified lines
1094 "crossbeam-channel",1198 "crossbeam-channel",
1095 "crossbeam-utils",1199 "crossbeam-utils",
1096 "flate2",1200 "flate2",
1097 "git-hash",1201 "git-hash 0.8.0",
1098 "jwalk",1202 "jwalk",
1099 "num_cpus",1203 "num_cpus",
1100 "parking_lot",1204 "parking_lot",
@@ -1106,6 +1210,27 @@ dependencies = [ · 5 unmodified lines
1106 "walkdir",1210 "walkdir",
1107]1211]
1108 1212
1213[[package]]
1214name = "git-features"
1215version = "0.18.0"
1216source = "registry+https://github.com/rust-lang/crates.io-index"
1217checksum = "909787991a2241c7143da504aa98069b30323bfc25a1c9ad94b06c4d5d888c87"
1218dependencies = [
1219 "crc32fast",
1220 "crossbeam-channel",
1221 "crossbeam-utils",
1222 "flate2",
1223 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1224 "jwalk",
1225 "num_cpus",
1226 "parking_lot",
1227 "prodash",
1228 "quick-error",
1229 "sha1",
1230 "time 0.3.5",
1231 "walkdir",
1232]
1233
1109[[package]]1234[[package]]
1110name = "git-hash"1235name = "git-hash"
1111version = "0.8.0"1236version = "0.8.0"
@@ -1115,6 +1240,16 @@ dependencies = [ · 3 unmodified lines
1115 "serde",1240 "serde",
1116]1241]
1117 1242
1243[[package]]
1244name = "git-hash"
1245version = "0.8.0"
1246source = "registry+https://github.com/rust-lang/crates.io-index"
1247checksum = "99707b9c4943f76a8875b6dd8a2e7291228c9e23c68253e403059ebf8117864e"
1248dependencies = [
1249 "hex",
1250 "quick-error",
1251]
1252
1118[[package]]1253[[package]]
1119name = "git-index"1254name = "git-index"
1120version = "0.0.0"1255version = "0.0.0"
@@ -1124,21 +1259,32 @@ name = "git-lock" · 3 unmodified lines
1124version = "1.0.1"1259version = "1.0.1"
1125dependencies = [1260dependencies = [
1126 "fastrand",1261 "fastrand",
1127 "git-tempfile",1262 "git-tempfile 1.0.3",
1128 "quick-error",1263 "quick-error",
1129 "tempfile",1264 "tempfile",
1130]1265]
1131 1266
1267[[package]]
1268name = "git-lock"
1269version = "1.0.1"
1270source = "registry+https://github.com/rust-lang/crates.io-index"
1271checksum = "24c6c0e6c2d893be08d8e10e61d01fbbbcfb8647d0dafc9ebdc6a8ee51bcf0b2"
1272dependencies = [
1273 "fastrand",
1274 "git-tempfile 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1275 "quick-error",
1276]
1277
1132[[package]]1278[[package]]
1133name = "git-object"1279name = "git-object"
1134version = "0.16.0"1280version = "0.16.0"
1135dependencies = [1281dependencies = [
1136 "bstr",1282 "bstr",
1137 "btoi",1283 "btoi",
1138 "git-actor",1284 "git-actor 0.7.0",
1139 "git-hash",1285 "git-hash 0.8.0",
1140 "git-testtools",1286 "git-testtools",
1141 "git-validate",1287 "git-validate 0.5.3",
1142 "hex",1288 "hex",
1143 "itoa",1289 "itoa",
1144 "nom",1290 "nom",
@@ -1148,22 +1294,55 @@ dependencies = [ · 3 unmodified lines
1148 "smallvec",1294 "smallvec",
1149]1295]
1150 1296
1297[[package]]
1298name = "git-object"
1299version = "0.16.0"
1300source = "registry+https://github.com/rust-lang/crates.io-index"
1301checksum = "b767d834fadad6d44749855f2ecb7f2b582412aa76c8996fb03d5d738369fc6e"
1302dependencies = [
1303 "bstr",
1304 "btoi",
1305 "git-actor 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1306 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1307 "git-validate 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
1308 "hex",
1309 "itoa",
1310 "nom",
1311 "quick-error",
1312 "smallvec",
1313]
1314
1151[[package]]1315[[package]]
1152name = "git-odb"1316name = "git-odb"
1153version = "0.25.0"1317version = "0.25.0"
1154dependencies = [1318dependencies = [
1155 "btoi",1319 "btoi",
1156 "git-actor",1320 "git-actor 0.7.0",
1157 "git-features",1321 "git-features 0.18.0",
1158 "git-hash",1322 "git-hash 0.8.0",
1159 "git-object",1323 "git-object 0.16.0",
1160 "git-pack",1324 "git-pack 0.15.0",
1161 "git-testtools",1325 "git-testtools",
1162 "pretty_assertions",1326 "pretty_assertions",
1163 "tempfile",1327 "tempfile",
1164 "thiserror",1328 "thiserror",
1165]1329]
1166 1330
1331[[package]]
1332name = "git-odb"
1333version = "0.25.0"
1334source = "registry+https://github.com/rust-lang/crates.io-index"
1335checksum = "b18761d35494ddddf0200d1d81d29949bd63d466d50def6a5af6ad0154f0a92f"
1336dependencies = [
1337 "btoi",
1338 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1339 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1340 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1341 "git-pack 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
1342 "tempfile",
1343 "thiserror",
1344]
1345
1167[[package]]1346[[package]]
1168name = "git-pack"1347name = "git-pack"
1169version = "0.15.0"1348version = "0.15.0"
@@ -1176,14 +1355,14 @@ dependencies = [ · 6 unmodified lines
1176 "common_macros",1355 "common_macros",
1177 "dashmap",1356 "dashmap",
1178 "filebuffer",1357 "filebuffer",
1179 "git-diff",1358 "git-diff 0.12.0",
1180 "git-features",1359 "git-features 0.18.0",
1181 "git-hash",1360 "git-hash 0.8.0",
1182 "git-object",1361 "git-object 0.16.0",
1183 "git-odb",1362 "git-odb 0.25.0",
1184 "git-tempfile",1363 "git-tempfile 1.0.3",
1185 "git-testtools",1364 "git-testtools",
1186 "git-traverse",1365 "git-traverse 0.11.0",
1187 "hex",1366 "hex",
1188 "itoa",1367 "itoa",
1189 "parking_lot",1368 "parking_lot",
@@ -1194,6 +1373,31 @@ dependencies = [ · 4 unmodified lines
1194 "uluru",1373 "uluru",
1195]1374]
1196 1375
1376[[package]]
1377name = "git-pack"
1378version = "0.15.0"
1379source = "registry+https://github.com/rust-lang/crates.io-index"
1380checksum = "f80b1e7fc99c0f3598c2c774396cccec8311018c00232a080cb4aa437f896903"
1381dependencies = [
1382 "btoi",
1383 "byteorder",
1384 "bytesize",
1385 "clru",
1386 "dashmap",
1387 "filebuffer",
1388 "git-diff 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
1389 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1390 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1391 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1392 "git-tempfile 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1393 "git-traverse 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
1394 "itoa",
1395 "parking_lot",
1396 "smallvec",
1397 "thiserror",
1398 "uluru",
1399]
1400
1197[[package]]1401[[package]]
1198name = "git-packetline"1402name = "git-packetline"
1199version = "0.12.2"1403version = "0.12.2"
@@ -1202,7 +1406,7 @@ dependencies = [ · 2 unmodified lines
1202 "bstr",1406 "bstr",
1203 "futures-io",1407 "futures-io",
1204 "futures-lite",1408 "futures-lite",
1205 "git-odb",1409 "git-odb 0.25.0",
1206 "hex",1410 "hex",
1207 "maybe-async",1411 "maybe-async",
1208 "pin-project-lite",1412 "pin-project-lite",
@@ -1210,6 +1414,20 @@ dependencies = [ · 1 unmodified line
1210 "serde",1414 "serde",
1211]1415]
1212 1416
1417[[package]]
1418name = "git-packetline"
1419version = "0.12.2"
1420source = "registry+https://github.com/rust-lang/crates.io-index"
1421checksum = "83bdb8d3f59f8746f0d0ecbb21066227931a8c2b02831c396e2fd7dc7c24b62b"
1422dependencies = [
1423 "bstr",
1424 "futures-io",
1425 "futures-lite",
1426 "hex",
1427 "pin-project-lite",
1428 "quick-error",
1429]
1430
1213[[package]]1431[[package]]
1214name = "git-protocol"1432name = "git-protocol"
1215version = "0.13.0"1433version = "0.13.0"
@@ -1220,31 +1438,50 @@ dependencies = [ · 4 unmodified lines
1220 "btoi",1438 "btoi",
1221 "futures-io",1439 "futures-io",
1222 "futures-lite",1440 "futures-lite",
1223 "git-features",1441 "git-features 0.18.0",
1224 "git-hash",1442 "git-hash 0.8.0",
1225 "git-packetline",1443 "git-packetline 0.12.2",
1226 "git-testtools",1444 "git-testtools",
1227 "git-transport",1445 "git-transport 0.14.0",
1228 "maybe-async",1446 "maybe-async",
1229 "nom",1447 "nom",
1230 "quick-error",1448 "quick-error",
1231 "serde",1449 "serde",
1232]1450]
1233 1451
1452[[package]]
1453name = "git-protocol"
1454version = "0.13.0"
1455source = "registry+https://github.com/rust-lang/crates.io-index"
1456checksum = "825154ac3732728d5ba9fbd249290c4d09c92865efd664a6b30921e96d4381e2"
1457dependencies = [
1458 "async-trait",
1459 "bstr",
1460 "btoi",
1461 "futures-io",
1462 "futures-lite",
1463 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1464 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1465 "git-transport 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
1466 "maybe-async",
1467 "nom",
1468 "quick-error",
1469]
1470
1234[[package]]1471[[package]]
1235name = "git-ref"1472name = "git-ref"
1236version = "0.10.0"1473version = "0.10.0"
1237dependencies = [1474dependencies = [
1238 "filebuffer",1475 "filebuffer",
1239 "git-actor",1476 "git-actor 0.7.0",
1240 "git-features",1477 "git-features 0.18.0",
1241 "git-hash",1478 "git-hash 0.8.0",
1242 "git-lock",1479 "git-lock 1.0.1",
1243 "git-object",1480 "git-object 0.16.0",
1244 "git-odb",1481 "git-odb 0.25.0",
1245 "git-tempfile",1482 "git-tempfile 1.0.3",
1246 "git-testtools",1483 "git-testtools",
1247 "git-validate",1484 "git-validate 0.5.3",
1248 "nom",1485 "nom",
1249 "os_str_bytes 3.1.0",1486 "os_str_bytes 3.1.0",
1250 "quick-error",1487 "quick-error",
@@ -1252,6 +1489,25 @@ dependencies = [ · 1 unmodified line
1252 "tempfile",1489 "tempfile",
1253]1490]
1254 1491
1492[[package]]
1493name = "git-ref"
1494version = "0.10.0"
1495source = "registry+https://github.com/rust-lang/crates.io-index"
1496checksum = "59dfdf42ba8e45b52f15a3005c76d6dbbb8129c137ab616e3adbc058750c7225"
1497dependencies = [
1498 "filebuffer",
1499 "git-actor 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1500 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1501 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1502 "git-lock 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1503 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1504 "git-tempfile 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1505 "git-validate 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
1506 "nom",
1507 "os_str_bytes 3.1.0",
1508 "quick-error",
1509]
1510
1255[[package]]1511[[package]]
1256name = "git-repository"1512name = "git-repository"
1257version = "0.13.0"1513version = "0.13.0"
@@ -1259,23 +1515,23 @@ dependencies = [ · 1 unmodified line
1259 "anyhow",1515 "anyhow",
1260 "byte-unit",1516 "byte-unit",
1261 "clru",1517 "clru",
1262 "git-actor",1518 "git-actor 0.7.0",
1263 "git-config",1519 "git-config 0.1.9",
1264 "git-diff",1520 "git-diff 0.12.0",
1265 "git-features",1521 "git-features 0.18.0",
1266 "git-hash",1522 "git-hash 0.8.0",
1267 "git-lock",1523 "git-lock 1.0.1",
1268 "git-object",1524 "git-object 0.16.0",
1269 "git-odb",1525 "git-odb 0.25.0",
1270 "git-pack",1526 "git-pack 0.15.0",
1271 "git-protocol",1527 "git-protocol 0.13.0",
1272 "git-ref",1528 "git-ref 0.10.0",
1273 "git-tempfile",1529 "git-tempfile 1.0.3",
1274 "git-testtools",1530 "git-testtools",
1275 "git-transport",1531 "git-transport 0.14.0",
1276 "git-traverse",1532 "git-traverse 0.11.0",
1277 "git-url",1533 "git-url 0.3.4",
1278 "git-validate",1534 "git-validate 0.5.3",
1279 "log",1535 "log",
1280 "parking_lot",1536 "parking_lot",
1281 "signal-hook",1537 "signal-hook",
@@ -1283,6 +1539,34 @@ dependencies = [ · 1 unmodified line
1283 "thiserror",1539 "thiserror",
1284]1540]
1285 1541
1542[[package]]
1543name = "git-repository"
1544version = "0.13.0"
1545source = "registry+https://github.com/rust-lang/crates.io-index"
1546checksum = "0ec3a5ab31b313ea0bd8c93b7091df24689700af56362975e7318a91786fbb2a"
1547dependencies = [
1548 "byte-unit",
1549 "clru",
1550 "git-actor 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1551 "git-config 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
1552 "git-diff 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
1553 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1554 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1555 "git-lock 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1556 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1557 "git-odb 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
1558 "git-pack 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
1559 "git-ref 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
1560 "git-tempfile 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1561 "git-traverse 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
1562 "git-url 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
1563 "git-validate 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
1564 "log",
1565 "parking_lot",
1566 "signal-hook",
1567 "thiserror",
1568]
1569
1286[[package]]1570[[package]]
1287name = "git-tempfile"1571name = "git-tempfile"
1288version = "1.0.3"1572version = "1.0.3"
@@ -1295,6 +1579,20 @@ dependencies = [ · 6 unmodified lines
1295 "tempfile",1579 "tempfile",
1296]1580]
1297 1581
1582[[package]]
1583name = "git-tempfile"
1584version = "1.0.3"
1585source = "registry+https://github.com/rust-lang/crates.io-index"
1586checksum = "046792b44be24ca39889f2a5cf202ca7fbcf96b66392cfbfa406a990219a47ba"
1587dependencies = [
1588 "dashmap",
1589 "libc",
1590 "once_cell",
1591 "signal-hook",
1592 "signal-hook-registry",
1593 "tempfile",
1594]
1595
1298[[package]]1596[[package]]
1299name = "git-testtools"1597name = "git-testtools"
1300version = "0.6.0"1598version = "0.6.0"
@@ -1302,7 +1600,7 @@ dependencies = [ · 1 unmodified line
1302 "bstr",1600 "bstr",
1303 "crc",1601 "crc",
1304 "fs_extra",1602 "fs_extra",
1305 "git-hash",1603 "git-hash 0.8.0",
1306 "nom",1604 "nom",
1307 "once_cell",1605 "once_cell",
1308 "tempfile",1606 "tempfile",
@@ -1320,10 +1618,10 @@ dependencies = [ · 11 unmodified lines
1320 "curl",1618 "curl",
1321 "futures-io",1619 "futures-io",
1322 "futures-lite",1620 "futures-lite",
1323 "git-features",1621 "git-features 0.18.0",
1324 "git-pack",1622 "git-pack 0.15.0",
1325 "git-packetline",1623 "git-packetline 0.12.2",
1326 "git-url",1624 "git-url 0.3.4",
1327 "maybe-async",1625 "maybe-async",
1328 "pin-project-lite",1626 "pin-project-lite",
1329 "quick-error",1627 "quick-error",
@@ -1331,17 +1629,46 @@ dependencies = [ · 1 unmodified line
1331 "thiserror",1629 "thiserror",
1332]1630]
1333 1631
1632[[package]]
1633name = "git-transport"
1634version = "0.14.0"
1635source = "registry+https://github.com/rust-lang/crates.io-index"
1636checksum = "d549996399b263d3eceb7a2f6f59e78ae85ed150eb9c16187bf4df89f5544331"
1637dependencies = [
1638 "async-trait",
1639 "bstr",
1640 "futures-io",
1641 "futures-lite",
1642 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
1643 "git-packetline 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
1644 "git-url 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
1645 "pin-project-lite",
1646 "quick-error",
1647 "thiserror",
1648]
1649
1334[[package]]1650[[package]]
1335name = "git-traverse"1651name = "git-traverse"
1336version = "0.11.0"1652version = "0.11.0"
1337dependencies = [1653dependencies = [
1338 "git-hash",1654 "git-hash 0.8.0",
1339 "git-object",1655 "git-object 0.16.0",
1340 "git-odb",1656 "git-odb 0.25.0",
1341 "git-testtools",1657 "git-testtools",
1342 "quick-error",1658 "quick-error",
1343]1659]
1344 1660
1661[[package]]
1662name = "git-traverse"
1663version = "0.11.0"
1664source = "registry+https://github.com/rust-lang/crates.io-index"
1665checksum = "af7e58e22a4038ed047cd480e11a6bb44e5c47d0a5489eb395d773f684f30012"
1666dependencies = [
1667 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
1668 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
1669 "quick-error",
1670]
1671
1345[[package]]1672[[package]]
1346name = "git-tui"1673name = "git-tui"
1347version = "0.0.0"1674version = "0.0.0"
@@ -1357,6 +1684,18 @@ dependencies = [ · 9 unmodified lines
1357 "url",1684 "url",
1358]1685]
1359 1686
1687[[package]]
1688name = "git-url"
1689version = "0.3.4"
1690source = "registry+https://github.com/rust-lang/crates.io-index"
1691checksum = "866e8deb986b21d4e206d7fa690bac3a5b5072293cae1eeec09c4494f4a4eaaa"
1692dependencies = [
1693 "bstr",
1694 "home",
1695 "quick-error",
1696 "url",
1697]
1698
1360[[package]]1699[[package]]
1361name = "git-validate"1700name = "git-validate"
1362version = "0.5.3"1701version = "0.5.3"
@@ -1366,6 +1705,16 @@ dependencies = [ · 3 unmodified lines
1366 "quick-error",1705 "quick-error",
1367]1706]
1368 1707
1708[[package]]
1709name = "git-validate"
1710version = "0.5.3"
1711source = "registry+https://github.com/rust-lang/crates.io-index"
1712checksum = "c58bafc6cd6f455a95997c47823182dd62cdb47f03564c44c6b6d910221801dc"
1713dependencies = [
1714 "bstr",
1715 "quick-error",
1716]
1717
1369[[package]]1718[[package]]
1370name = "git2"1719name = "git2"
1371version = "0.13.24"1720version = "0.13.24"
@@ -1392,9 +1741,9 @@ dependencies = [ · 20 unmodified lines
1392 "crosstermion",1741 "crosstermion",
1393 "env_logger",1742 "env_logger",
1394 "futures-lite",1743 "futures-lite",
1395 "git-features",1744 "git-features 0.18.0",
1396 "git-repository",1745 "git-repository 0.13.0",
1397 "git-transport",1746 "git-transport 0.14.0",
1398 "gitoxide-core",1747 "gitoxide-core",
1399 "prodash",1748 "prodash",
1400]1749]
@@ -1413,10 +1762,10 @@ dependencies = [ · 12 unmodified lines
1413 "futures-io",1762 "futures-io",
1414 "futures-lite",1763 "futures-lite",
1415 "git-commitgraph",1764 "git-commitgraph",
1416 "git-config",1765 "git-config 0.1.9",
1417 "git-pack",1766 "git-pack 0.15.0",
1418 "git-repository",1767 "git-repository 0.13.0",
1419 "git-url",1768 "git-url 0.3.4",
1420 "itertools",1769 "itertools",
1421 "jwalk",1770 "jwalk",
1422 "os_str_bytes 3.1.0",1771 "os_str_bytes 3.1.0",
@@ -1520,6 +1869,20 @@ dependencies = [ · 97 unmodified lines
1520 "unicode-normalization",1869 "unicode-normalization",
1521]1870]
1522 1871
1872[[package]]
1873name = "im"
1874version = "15.0.0"
1875source = "registry+https://github.com/rust-lang/crates.io-index"
1876checksum = "111c1983f3c5bb72732df25cddacee9b546d08325fb584b5ebd38148be7b0246"
1877dependencies = [
1878 "bitmaps",
1879 "rand_core 0.5.1",
1880 "rand_xoshiro",
1881 "sized-chunks",
1882 "typenum",
1883 "version_check",
1884]
1885
1523[[package]]1886[[package]]
1524name = "indexmap"1887name = "indexmap"
1525version = "1.7.0"1888version = "1.7.0"
@@ -1659,6 +2022,40 @@ dependencies = [ · 133 unmodified lines
1659 "vcpkg",2022 "vcpkg",
1660]2023]
1661 2024
2025[[package]]
2026name = "link-git"
2027version = "0.1.0"
2028source = "git+https://github.com/Byron/radicle-link.git?rev=6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911#6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911"
2029dependencies = [
2030 "arc-swap",
2031 "async-process",
2032 "async-trait",
2033 "blocking",
2034 "bstr",
2035 "futures-lite",
2036 "futures-util",
2037 "git-actor 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
2038 "git-features 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
2039 "git-hash 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
2040 "git-lock 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
2041 "git-object 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
2042 "git-odb 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)",
2043 "git-pack 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
2044 "git-packetline 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
2045 "git-protocol 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
2046 "git-ref 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
2047 "git-traverse 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
2048 "im",
2049 "once_cell",
2050 "parking_lot",
2051 "pin-project",
2052 "rustc-hash",
2053 "tempfile",
2054 "thiserror",
2055 "tracing",
2056 "versions",
2057]
2058
1662[[package]]2059[[package]]
1663name = "linked-hash-map"2060name = "linked-hash-map"
1664version = "0.5.4"2061version = "0.5.4"
@@ -1832,8 +2229,9 @@ name = "object-access" · 167 unmodified lines
1832version = "0.1.0"2229version = "0.1.0"
1833dependencies = [2230dependencies = [
1834 "anyhow",2231 "anyhow",
1835 "git-repository",2232 "git-repository 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
1836 "git2",2233 "git2",
2234 "link-git",
1837 "parking_lot",2235 "parking_lot",
1838 "rayon",2236 "rayon",
1839]2237]
@@ -1843,10 +2241,10 @@ name = "odb-redesign" · 3 unmodified lines
1843version = "0.1.0"2241version = "0.1.0"
1844dependencies = [2242dependencies = [
1845 "anyhow",2243 "anyhow",
1846 "git-hash",2244 "git-hash 0.8.0",
1847 "git-odb",2245 "git-odb 0.25.0",
1848 "git-pack",2246 "git-pack 0.15.0",
1849 "git-ref",2247 "git-ref 0.10.0",
1850 "parking_lot",2248 "parking_lot",
1851 "thiserror",2249 "thiserror",
1852]2250]
@@ -1959,6 +2357,26 @@ version = "2.1.0" · 106 unmodified lines
1959source = "registry+https://github.com/rust-lang/crates.io-index"2357source = "registry+https://github.com/rust-lang/crates.io-index"
1960checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"2358checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
1961 2359
2360[[package]]
2361name = "pin-project"
2362version = "1.0.8"
2363source = "registry+https://github.com/rust-lang/crates.io-index"
2364checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08"
2365dependencies = [
2366 "pin-project-internal",
2367]
2368
2369[[package]]
2370name = "pin-project-internal"
2371version = "1.0.8"
2372source = "registry+https://github.com/rust-lang/crates.io-index"
2373checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
2374dependencies = [
2375 "proc-macro2",
2376 "quote",
2377 "syn",
2378]
2379
1962[[package]]2380[[package]]
1963name = "pin-project-lite"2381name = "pin-project-lite"
1964version = "0.2.7"2382version = "0.2.7"
@@ -2060,6 +2478,18 @@ dependencies = [ · 95 unmodified lines
2060 "version_check",2478 "version_check",
2061]2479]
2062 2480
2481[[package]]
2482name = "proc-macro-hack"
2483version = "0.5.19"
2484source = "registry+https://github.com/rust-lang/crates.io-index"
2485checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
2486
2487[[package]]
2488name = "proc-macro-nested"
2489version = "0.1.7"
2490source = "registry+https://github.com/rust-lang/crates.io-index"
2491checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
2492
2063[[package]]2493[[package]]
2064name = "proc-macro2"2494name = "proc-macro2"
2065version = "1.0.32"2495version = "1.0.32"
@@ -2128,7 +2558,7 @@ checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" · 62 unmodified lines
2128dependencies = [2558dependencies = [
2129 "libc",2559 "libc",
2130 "rand_chacha",2560 "rand_chacha",
2131 "rand_core",2561 "rand_core 0.6.3",
2132 "rand_hc",2562 "rand_hc",
2133]2563]
2134 2564
@@ -2139,9 +2569,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" · 4 unmodified lines
2139checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"2569checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
2140dependencies = [2570dependencies = [
2141 "ppv-lite86",2571 "ppv-lite86",
2142 "rand_core",2572 "rand_core 0.6.3",
2143]2573]
2144 2574
2575[[package]]
2576name = "rand_core"
2577version = "0.5.1"
2578source = "registry+https://github.com/rust-lang/crates.io-index"
2579checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
2580
2145[[package]]2581[[package]]
2146name = "rand_core"2582name = "rand_core"
2147version = "0.6.3"2583version = "0.6.3"
@@ -2157,7 +2593,16 @@ version = "0.3.1" · 9 unmodified lines
2157source = "registry+https://github.com/rust-lang/crates.io-index"2593source = "registry+https://github.com/rust-lang/crates.io-index"
2158checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"2594checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
2159dependencies = [2595dependencies = [
2160 "rand_core",2596 "rand_core 0.6.3",
2597]
2598
2599[[package]]
2600name = "rand_xoshiro"
2601version = "0.4.0"
2602source = "registry+https://github.com/rust-lang/crates.io-index"
2603checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
2604dependencies = [
2605 "rand_core 0.5.1",
2161]2606]
2162 2607
2163[[package]]2608[[package]]
@@ -2243,6 +2688,12 @@ dependencies = [ · 79 unmodified lines
2243 "winapi",2688 "winapi",
2244]2689]
2245 2690
2691[[package]]
2692name = "rustc-hash"
2693version = "1.1.0"
2694source = "registry+https://github.com/rust-lang/crates.io-index"
2695checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
2696
2246[[package]]2697[[package]]
2247name = "rustc_version"2698name = "rustc_version"
2248version = "0.4.0"2699version = "0.4.0"
@@ -2432,6 +2883,16 @@ version = "1.3.0" · 183 unmodified lines
2432source = "registry+https://github.com/rust-lang/crates.io-index"2883source = "registry+https://github.com/rust-lang/crates.io-index"
2433checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"2884checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
2434 2885
2886[[package]]
2887name = "sized-chunks"
2888version = "0.6.5"
2889source = "registry+https://github.com/rust-lang/crates.io-index"
2890checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e"
2891dependencies = [
2892 "bitmaps",
2893 "typenum",
2894]
2895
2435[[package]]2896[[package]]
2436name = "slab"2897name = "slab"
2437version = "0.4.5"2898version = "0.4.5"
@@ -2638,13 +3099,45 @@ dependencies = [ · 200 unmodified lines
2638 "linked-hash-map",3099 "linked-hash-map",
2639]3100]
2640 3101
3102[[package]]
3103name = "tracing"
3104version = "0.1.29"
3105source = "registry+https://github.com/rust-lang/crates.io-index"
3106checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
3107dependencies = [
3108 "cfg-if",
3109 "pin-project-lite",
3110 "tracing-attributes",
3111 "tracing-core",
3112]
3113
3114[[package]]
3115name = "tracing-attributes"
3116version = "0.1.18"
3117source = "registry+https://github.com/rust-lang/crates.io-index"
3118checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
3119dependencies = [
3120 "proc-macro2",
3121 "quote",
3122 "syn",
3123]
3124
3125[[package]]
3126name = "tracing-core"
3127version = "0.1.21"
3128source = "registry+https://github.com/rust-lang/crates.io-index"
3129checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
3130dependencies = [
3131 "lazy_static",
3132]
3133
2641[[package]]3134[[package]]
2642name = "traversal"3135name = "traversal"
2643version = "0.1.0"3136version = "0.1.0"
2644dependencies = [3137dependencies = [
2645 "anyhow",3138 "anyhow",
2646 "dashmap",3139 "dashmap",
2647 "git-repository",3140 "git-repository 0.13.0",
2648 "git2",3141 "git2",
2649 "rayon",3142 "rayon",
2650]3143]
@@ -2778,6 +3271,16 @@ version = "0.9.3" · 127 unmodified lines
2778source = "registry+https://github.com/rust-lang/crates.io-index"3271source = "registry+https://github.com/rust-lang/crates.io-index"
2779checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"3272checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
2780 3273
3274[[package]]
3275name = "versions"
3276version = "3.0.3"
3277source = "registry+https://github.com/rust-lang/crates.io-index"
3278checksum = "5cd9a7a22c45daf5aeb6bea3dff4ecbb8eb43e492582d467b18ce2979b512cbe"
3279dependencies = [
3280 "itertools",
3281 "nom",
3282]
3283
2781[[package]]3284[[package]]
2782name = "waker-fn"3285name = "waker-fn"
2783version = "1.1.0"3286version = "1.1.0"
experiments/object-access/Cargo.toml+5−1
@@ -7,9 +7,13 @@ publish = false · 6 unmodified lines
7 7
8# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html8# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
9 9
10[features]
11radicle-nightly = ["link-git"]
12
10[dependencies]13[dependencies]
11anyhow = "1"14anyhow = "1"
12git-repository = { version ="^0.13.0", path = "../../git-repository", features = ["unstable"] }15git-repository = { version ="^0.13.0", features = ["unstable"] }
13git2 = "0.13"16git2 = "0.13"
17link-git = { git = "https://github.com/Byron/radicle-link.git", rev = "6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911", optional = true }
14rayon = "1.5.0"18rayon = "1.5.0"
15parking_lot = { version = "0.11.0", default-features = false }19parking_lot = { version = "0.11.0", default-features = false }
experiments/object-access/src/main.rs+71−1
@@ -1,7 +1,7 @@
1use std::{path::Path, sync::Arc, time::Instant};1use std::{path::Path, sync::Arc, time::Instant};
2 2
3use anyhow::anyhow;3use anyhow::anyhow;
4use git_repository::{hash::ObjectId, odb, prelude::*, Repository};4use git_repository::{hash::ObjectId, odb, Repository};
5 5
6const GITOXIDE_STATIC_CACHE_SIZE: usize = 64;6const GITOXIDE_STATIC_CACHE_SIZE: usize = 64;
7const GITOXIDE_CACHED_OBJECT_DATA_PER_THREAD_IN_BYTES: usize = 60_000_000;7const GITOXIDE_CACHED_OBJECT_DATA_PER_THREAD_IN_BYTES: usize = 60_000_000;
@@ -32,6 +32,19 @@ fn main() -> anyhow::Result<()> { · 24 unmodified lines
32 objs_per_sec(elapsed)32 objs_per_sec(elapsed)
33 );33 );
34 34
35 #[cfg(feature = "radicle-nightly")]
36 {
37 let start = Instant::now();
38 do_link_git_in_parallel(&hashes, &repo, || odb::pack::cache::Never, AccessMode::ObjectExists)?;
39 let elapsed = start.elapsed();
40 println!(
41 "parallel radicle-link-git : confirmed {} objects exists in {:?} ({:0.0} objects/s)",
42 hashes.len(),
43 elapsed,
44 objs_per_sec(elapsed)
45 );
46 }
47
35 let start = Instant::now();48 let start = Instant::now();
36 let bytes = do_gitoxide_in_parallel_through_arc(49 let bytes = do_gitoxide_in_parallel_through_arc(
37 &hashes,50 &hashes,
@@ -47,6 +60,19 @@ fn main() -> anyhow::Result<()> { · 9 unmodified lines
47 objs_per_sec(elapsed)60 objs_per_sec(elapsed)
48 );61 );
49 62
63 #[cfg(feature = "radicle-nightly")]
64 {
65 let start = Instant::now();
66 let bytes = do_link_git_in_parallel(&hashes, &repo, odb::pack::cache::Never::default, AccessMode::ObjectData)?;
67 let elapsed = start.elapsed();
68 println!(
69 "parallel radicle-link-git (uncached, Arc): confirmed {} bytes in {:?} ({:0.0} objects/s)",
70 bytes,
71 elapsed,
72 objs_per_sec(elapsed)
73 );
74 }
75
50 let start = Instant::now();76 let start = Instant::now();
51 do_gitoxide_in_parallel_through_arc(77 do_gitoxide_in_parallel_through_arc(
52 &hashes,78 &hashes,
@@ -230,6 +256,7 @@ fn do_gitoxide<C>(hashes: &[ObjectId], repo: &Repository, new_cache: impl FnOnce · 177 unmodified lines
230where256where
231 C: odb::pack::cache::DecodeEntry,257 C: odb::pack::cache::DecodeEntry,
232{258{
259 use git_repository::prelude::FindExt;
233 let mut buf = Vec::new();260 let mut buf = Vec::new();
234 let mut bytes = 0u64;261 let mut bytes = 0u64;
235 let mut cache = new_cache();262 let mut cache = new_cache();
@@ -254,6 +281,7 @@ fn do_gitoxide_in_parallel<C>( · 18 unmodified lines
254where281where
255 C: odb::pack::cache::DecodeEntry,282 C: odb::pack::cache::DecodeEntry,
256{283{
284 use git_repository::prelude::FindExt;
257 use rayon::prelude::*;285 use rayon::prelude::*;
258 let bytes = std::sync::atomic::AtomicU64::default();286 let bytes = std::sync::atomic::AtomicU64::default();
259 hashes.par_iter().try_for_each_init::<_, _, _, anyhow::Result<_>>(287 hashes.par_iter().try_for_each_init::<_, _, _, anyhow::Result<_>>(
@@ -275,6 +303,46 @@ where · 15 unmodified lines
275 Ok(bytes.load(std::sync::atomic::Ordering::Acquire))303 Ok(bytes.load(std::sync::atomic::Ordering::Acquire))
276}304}
277 305
306/// A fully sync implementation but with interior mutability
307#[cfg(feature = "radicle-nightly")]
308fn do_link_git_in_parallel<C>(
309 hashes: &[ObjectId],
310 repo: &Repository,
311 new_cache: impl Fn() -> C + Sync + Send,
312 mode: AccessMode,
313) -> anyhow::Result<u64>
314where
315 C: odb::pack::cache::DecodeEntry,
316{
317 use rayon::prelude::*;
318 use std::iter::FromIterator;
319 let bytes = std::sync::atomic::AtomicU64::default();
320 let repo = link_git::odb::Odb {
321 loose: link_git::odb::backend::Loose::at(repo.objects_dir()),
322 packed: link_git::odb::backend::Packed {
323 index: link_git::odb::index::Shared::from_iter(link_git::odb::index::discover(repo.git_dir())?),
324 data: link_git::odb::window::Large::default(),
325 },
326 };
327 hashes.par_iter().try_for_each_init::<_, _, _, anyhow::Result<_>>(
328 || (Vec::new(), new_cache()),
329 |(buf, cache), hash| {
330 match mode {
331 AccessMode::ObjectData => {
332 let obj = repo.find(hash, buf, cache)?.expect("exists");
333 bytes.fetch_add(obj.data.len() as u64, std::sync::atomic::Ordering::Relaxed);
334 }
335 AccessMode::ObjectExists => {
336 assert!(repo.contains(hash), "each traversed object exists");
337 }
338 }
339 Ok(())
340 },
341 )?;
342
343 Ok(bytes.load(std::sync::atomic::Ordering::Acquire))
344}
345
278fn do_gitoxide_in_parallel_through_arc<C>(346fn do_gitoxide_in_parallel_through_arc<C>(
279 hashes: &[ObjectId],347 hashes: &[ObjectId],
280 repo: &Path,348 repo: &Path,
@@ -284,6 +352,7 @@ fn do_gitoxide_in_parallel_through_arc<C>( · 3 unmodified lines
284where352where
285 C: odb::pack::cache::DecodeEntry,353 C: odb::pack::cache::DecodeEntry,
286{354{
355 use git_repository::prelude::FindExt;
287 let bytes = std::sync::atomic::AtomicU64::default();356 let bytes = std::sync::atomic::AtomicU64::default();
288 let odb = Arc::new(git_repository::odb::linked::Store::at(repo)?);357 let odb = Arc::new(git_repository::odb::linked::Store::at(repo)?);
289 358
@@ -319,6 +388,7 @@ fn do_gitoxide_in_parallel_through_arc_rw_lock<C>( · 29 unmodified lines
319where388where
320 C: odb::pack::cache::DecodeEntry,389 C: odb::pack::cache::DecodeEntry,
321{390{
391 use git_repository::prelude::FindExt;
322 let bytes = std::sync::atomic::AtomicU64::default();392 let bytes = std::sync::atomic::AtomicU64::default();
323 let odb = Arc::new(parking_lot::RwLock::new(git_repository::odb::linked::Store::at(repo)?));393 let odb = Arc::new(parking_lot::RwLock::new(git_repository::odb::linked::Store::at(repo)?));
324 394