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
3434 source = "registry+https://github.com/rust-lang/crates.io-index"
3535 checksum = "38d9ff5d688f1c13395289f67db01d4826b46dd694e7580accdc3e8430f2d98e"
3636
37+[[package]]
38+name = "arc-swap"
39+version = "1.5.0"
40+source = "registry+https://github.com/rust-lang/crates.io-index"
41+checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f"
42+
3743 [[package]]
3844 name = "argh"
3945 version = "0.1.6"
@@ -168,6 +174,23 @@ dependencies = [ · 128 unmodified lines
168174 "futures-lite",
169175 ]
170176
177+[[package]]
178+name = "async-process"
179+version = "1.3.0"
180+source = "registry+https://github.com/rust-lang/crates.io-index"
181+checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6"
182+dependencies = [
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+
171194 [[package]]
172195 name = "async-std"
173196 version = "1.10.0"
@@ -248,6 +271,15 @@ version = "1.3.2" · 74 unmodified lines
248271 source = "registry+https://github.com/rust-lang/crates.io-index"
249272 checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
250273
274+[[package]]
275+name = "bitmaps"
276+version = "2.1.0"
277+source = "registry+https://github.com/rust-lang/crates.io-index"
278+checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
279+dependencies = [
280+ "typenum",
281+]
282+
251283 [[package]]
252284 name = "block-buffer"
253285 version = "0.9.0"
@@ -361,7 +393,7 @@ dependencies = [ · 107 unmodified lines
361393 "crates-index",
362394 "env_logger",
363395 "git-conventional",
364− "git-repository",
396+ "git-repository 0.13.0",
365397 "git-testtools",
366398 "insta",
367399 "log",
@@ -815,7 +847,7 @@ name = "diffing" · 447 unmodified lines
815847 version = "0.1.0"
816848 dependencies = [
817849 "anyhow",
818− "git-repository",
850+ "git-repository 0.13.0",
819851 "git2",
820852 "memory-lru",
821853 "rayon",
@@ -983,12 +1015,48 @@ dependencies = [ · 161 unmodified lines
9831015 "waker-fn",
9841016 ]
9851017
1018+[[package]]
1019+name = "futures-macro"
1020+version = "0.3.17"
1021+source = "registry+https://github.com/rust-lang/crates.io-index"
1022+checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb"
1023+dependencies = [
1024+ "autocfg",
1025+ "proc-macro-hack",
1026+ "proc-macro2",
1027+ "quote",
1028+ "syn",
1029+]
1030+
9861031 [[package]]
9871032 name = "futures-sink"
9881033 version = "0.3.17"
9891034 source = "registry+https://github.com/rust-lang/crates.io-index"
9901035 checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11"
9911036
1037+[[package]]
1038+name = "futures-task"
1039+version = "0.3.18"
1040+source = "registry+https://github.com/rust-lang/crates.io-index"
1041+checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12"
1042+
1043+[[package]]
1044+name = "futures-util"
1045+version = "0.3.17"
1046+source = "registry+https://github.com/rust-lang/crates.io-index"
1047+checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
1048+dependencies = [
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+
9921060 [[package]]
9931061 name = "generic-array"
9941062 version = "0.14.4"
@@ -1025,7 +1093,7 @@ version = "0.7.0" · 30 unmodified lines
10251093 dependencies = [
10261094 "bstr",
10271095 "btoi",
1028− "git-features",
1096+ "git-features 0.18.0",
10291097 "git-testtools",
10301098 "itoa",
10311099 "nom",
@@ -1034,6 +1102,20 @@ dependencies = [ · 2 unmodified lines
10341102 "serde",
10351103 ]
10361104
1105+[[package]]
1106+name = "git-actor"
1107+version = "0.7.0"
1108+source = "registry+https://github.com/rust-lang/crates.io-index"
1109+checksum = "5f14e997873247d4c4f496aa63d5dc6894245ec3778618a41342ef7ad5b63456"
1110+dependencies = [
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+
10371119 [[package]]
10381120 name = "git-commitgraph"
10391121 version = "0.7.0"
@@ -1041,8 +1123,8 @@ dependencies = [ · 1 unmodified line
10411123 "bstr",
10421124 "byteorder",
10431125 "filebuffer",
1044− "git-features",
1045− "git-hash",
1126+ "git-features 0.18.0",
1127+ "git-hash 0.8.0",
10461128 "git-testtools",
10471129 "serde",
10481130 "thiserror",
@@ -1062,6 +1144,17 @@ dependencies = [ · 13 unmodified lines
10621144 "tempfile",
10631145 ]
10641146
1147+[[package]]
1148+name = "git-config"
1149+version = "0.1.9"
1150+source = "registry+https://github.com/rust-lang/crates.io-index"
1151+checksum = "5e3d08dabb27607a8bfd1a3c7d5c8aabc83a0e119dee6b8ae8876c1f68cd7dc7"
1152+dependencies = [
1153+ "dirs",
1154+ "memchr",
1155+ "nom",
1156+]
1157+
10651158 [[package]]
10661159 name = "git-conventional"
10671160 version = "0.10.3"
@@ -1077,11 +1170,22 @@ dependencies = [ · 9 unmodified lines
10771170 name = "git-diff"
10781171 version = "0.12.0"
10791172 dependencies = [
1080− "git-hash",
1081− "git-object",
1082− "git-odb",
1173+ "git-hash 0.8.0",
1174+ "git-object 0.16.0",
1175+ "git-odb 0.25.0",
10831176 "git-testtools",
1084− "git-traverse",
1177+ "git-traverse 0.11.0",
1178+ "quick-error",
1179+]
1180+
1181+[[package]]
1182+name = "git-diff"
1183+version = "0.12.0"
1184+source = "registry+https://github.com/rust-lang/crates.io-index"
1185+checksum = "e6dc5ee60f47ea1d35aa4c79cbf338cdf4b91c9a03ad0dadd1f66bfdfaa57d61"
1186+dependencies = [
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)",
10851189 "quick-error",
10861190 ]
10871191
@@ -1094,7 +1198,7 @@ dependencies = [ · 6 unmodified lines
10941198 "crossbeam-channel",
10951199 "crossbeam-utils",
10961200 "flate2",
1097− "git-hash",
1201+ "git-hash 0.8.0",
10981202 "jwalk",
10991203 "num_cpus",
11001204 "parking_lot",
@@ -1106,6 +1210,27 @@ dependencies = [ · 5 unmodified lines
11061210 "walkdir",
11071211 ]
11081212
1213+[[package]]
1214+name = "git-features"
1215+version = "0.18.0"
1216+source = "registry+https://github.com/rust-lang/crates.io-index"
1217+checksum = "909787991a2241c7143da504aa98069b30323bfc25a1c9ad94b06c4d5d888c87"
1218+dependencies = [
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+
11091234 [[package]]
11101235 name = "git-hash"
11111236 version = "0.8.0"
@@ -1115,6 +1240,16 @@ dependencies = [ · 3 unmodified lines
11151240 "serde",
11161241 ]
11171242
1243+[[package]]
1244+name = "git-hash"
1245+version = "0.8.0"
1246+source = "registry+https://github.com/rust-lang/crates.io-index"
1247+checksum = "99707b9c4943f76a8875b6dd8a2e7291228c9e23c68253e403059ebf8117864e"
1248+dependencies = [
1249+ "hex",
1250+ "quick-error",
1251+]
1252+
11181253 [[package]]
11191254 name = "git-index"
11201255 version = "0.0.0"
@@ -1124,21 +1259,32 @@ name = "git-lock" · 3 unmodified lines
11241259 version = "1.0.1"
11251260 dependencies = [
11261261 "fastrand",
1127− "git-tempfile",
1262+ "git-tempfile 1.0.3",
11281263 "quick-error",
11291264 "tempfile",
11301265 ]
11311266
1267+[[package]]
1268+name = "git-lock"
1269+version = "1.0.1"
1270+source = "registry+https://github.com/rust-lang/crates.io-index"
1271+checksum = "24c6c0e6c2d893be08d8e10e61d01fbbbcfb8647d0dafc9ebdc6a8ee51bcf0b2"
1272+dependencies = [
1273+ "fastrand",
1274+ "git-tempfile 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1275+ "quick-error",
1276+]
1277+
11321278 [[package]]
11331279 name = "git-object"
11341280 version = "0.16.0"
11351281 dependencies = [
11361282 "bstr",
11371283 "btoi",
1138− "git-actor",
1139− "git-hash",
1284+ "git-actor 0.7.0",
1285+ "git-hash 0.8.0",
11401286 "git-testtools",
1141− "git-validate",
1287+ "git-validate 0.5.3",
11421288 "hex",
11431289 "itoa",
11441290 "nom",
@@ -1148,22 +1294,55 @@ dependencies = [ · 3 unmodified lines
11481294 "smallvec",
11491295 ]
11501296
1297+[[package]]
1298+name = "git-object"
1299+version = "0.16.0"
1300+source = "registry+https://github.com/rust-lang/crates.io-index"
1301+checksum = "b767d834fadad6d44749855f2ecb7f2b582412aa76c8996fb03d5d738369fc6e"
1302+dependencies = [
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+
11511315 [[package]]
11521316 name = "git-odb"
11531317 version = "0.25.0"
11541318 dependencies = [
11551319 "btoi",
1156− "git-actor",
1157− "git-features",
1158− "git-hash",
1159− "git-object",
1160− "git-pack",
1320+ "git-actor 0.7.0",
1321+ "git-features 0.18.0",
1322+ "git-hash 0.8.0",
1323+ "git-object 0.16.0",
1324+ "git-pack 0.15.0",
11611325 "git-testtools",
11621326 "pretty_assertions",
11631327 "tempfile",
11641328 "thiserror",
11651329 ]
11661330
1331+[[package]]
1332+name = "git-odb"
1333+version = "0.25.0"
1334+source = "registry+https://github.com/rust-lang/crates.io-index"
1335+checksum = "b18761d35494ddddf0200d1d81d29949bd63d466d50def6a5af6ad0154f0a92f"
1336+dependencies = [
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+
11671346 [[package]]
11681347 name = "git-pack"
11691348 version = "0.15.0"
@@ -1176,14 +1355,14 @@ dependencies = [ · 6 unmodified lines
11761355 "common_macros",
11771356 "dashmap",
11781357 "filebuffer",
1179− "git-diff",
1180− "git-features",
1181− "git-hash",
1182− "git-object",
1183− "git-odb",
1184− "git-tempfile",
1358+ "git-diff 0.12.0",
1359+ "git-features 0.18.0",
1360+ "git-hash 0.8.0",
1361+ "git-object 0.16.0",
1362+ "git-odb 0.25.0",
1363+ "git-tempfile 1.0.3",
11851364 "git-testtools",
1186− "git-traverse",
1365+ "git-traverse 0.11.0",
11871366 "hex",
11881367 "itoa",
11891368 "parking_lot",
@@ -1194,6 +1373,31 @@ dependencies = [ · 4 unmodified lines
11941373 "uluru",
11951374 ]
11961375
1376+[[package]]
1377+name = "git-pack"
1378+version = "0.15.0"
1379+source = "registry+https://github.com/rust-lang/crates.io-index"
1380+checksum = "f80b1e7fc99c0f3598c2c774396cccec8311018c00232a080cb4aa437f896903"
1381+dependencies = [
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+
11971401 [[package]]
11981402 name = "git-packetline"
11991403 version = "0.12.2"
@@ -1202,7 +1406,7 @@ dependencies = [ · 2 unmodified lines
12021406 "bstr",
12031407 "futures-io",
12041408 "futures-lite",
1205− "git-odb",
1409+ "git-odb 0.25.0",
12061410 "hex",
12071411 "maybe-async",
12081412 "pin-project-lite",
@@ -1210,6 +1414,20 @@ dependencies = [ · 1 unmodified line
12101414 "serde",
12111415 ]
12121416
1417+[[package]]
1418+name = "git-packetline"
1419+version = "0.12.2"
1420+source = "registry+https://github.com/rust-lang/crates.io-index"
1421+checksum = "83bdb8d3f59f8746f0d0ecbb21066227931a8c2b02831c396e2fd7dc7c24b62b"
1422+dependencies = [
1423+ "bstr",
1424+ "futures-io",
1425+ "futures-lite",
1426+ "hex",
1427+ "pin-project-lite",
1428+ "quick-error",
1429+]
1430+
12131431 [[package]]
12141432 name = "git-protocol"
12151433 version = "0.13.0"
@@ -1220,31 +1438,50 @@ dependencies = [ · 4 unmodified lines
12201438 "btoi",
12211439 "futures-io",
12221440 "futures-lite",
1223− "git-features",
1224− "git-hash",
1225− "git-packetline",
1441+ "git-features 0.18.0",
1442+ "git-hash 0.8.0",
1443+ "git-packetline 0.12.2",
12261444 "git-testtools",
1227− "git-transport",
1445+ "git-transport 0.14.0",
12281446 "maybe-async",
12291447 "nom",
12301448 "quick-error",
12311449 "serde",
12321450 ]
12331451
1452+[[package]]
1453+name = "git-protocol"
1454+version = "0.13.0"
1455+source = "registry+https://github.com/rust-lang/crates.io-index"
1456+checksum = "825154ac3732728d5ba9fbd249290c4d09c92865efd664a6b30921e96d4381e2"
1457+dependencies = [
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+
12341471 [[package]]
12351472 name = "git-ref"
12361473 version = "0.10.0"
12371474 dependencies = [
12381475 "filebuffer",
1239− "git-actor",
1240− "git-features",
1241− "git-hash",
1242− "git-lock",
1243− "git-object",
1244− "git-odb",
1245− "git-tempfile",
1476+ "git-actor 0.7.0",
1477+ "git-features 0.18.0",
1478+ "git-hash 0.8.0",
1479+ "git-lock 1.0.1",
1480+ "git-object 0.16.0",
1481+ "git-odb 0.25.0",
1482+ "git-tempfile 1.0.3",
12461483 "git-testtools",
1247− "git-validate",
1484+ "git-validate 0.5.3",
12481485 "nom",
12491486 "os_str_bytes 3.1.0",
12501487 "quick-error",
@@ -1252,6 +1489,25 @@ dependencies = [ · 1 unmodified line
12521489 "tempfile",
12531490 ]
12541491
1492+[[package]]
1493+name = "git-ref"
1494+version = "0.10.0"
1495+source = "registry+https://github.com/rust-lang/crates.io-index"
1496+checksum = "59dfdf42ba8e45b52f15a3005c76d6dbbb8129c137ab616e3adbc058750c7225"
1497+dependencies = [
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+
12551511 [[package]]
12561512 name = "git-repository"
12571513 version = "0.13.0"
@@ -1259,23 +1515,23 @@ dependencies = [ · 1 unmodified line
12591515 "anyhow",
12601516 "byte-unit",
12611517 "clru",
1262− "git-actor",
1263− "git-config",
1264− "git-diff",
1265− "git-features",
1266− "git-hash",
1267− "git-lock",
1268− "git-object",
1269− "git-odb",
1270− "git-pack",
1271− "git-protocol",
1272− "git-ref",
1273− "git-tempfile",
1518+ "git-actor 0.7.0",
1519+ "git-config 0.1.9",
1520+ "git-diff 0.12.0",
1521+ "git-features 0.18.0",
1522+ "git-hash 0.8.0",
1523+ "git-lock 1.0.1",
1524+ "git-object 0.16.0",
1525+ "git-odb 0.25.0",
1526+ "git-pack 0.15.0",
1527+ "git-protocol 0.13.0",
1528+ "git-ref 0.10.0",
1529+ "git-tempfile 1.0.3",
12741530 "git-testtools",
1275− "git-transport",
1276− "git-traverse",
1277− "git-url",
1278− "git-validate",
1531+ "git-transport 0.14.0",
1532+ "git-traverse 0.11.0",
1533+ "git-url 0.3.4",
1534+ "git-validate 0.5.3",
12791535 "log",
12801536 "parking_lot",
12811537 "signal-hook",
@@ -1283,6 +1539,34 @@ dependencies = [ · 1 unmodified line
12831539 "thiserror",
12841540 ]
12851541
1542+[[package]]
1543+name = "git-repository"
1544+version = "0.13.0"
1545+source = "registry+https://github.com/rust-lang/crates.io-index"
1546+checksum = "0ec3a5ab31b313ea0bd8c93b7091df24689700af56362975e7318a91786fbb2a"
1547+dependencies = [
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+
12861570 [[package]]
12871571 name = "git-tempfile"
12881572 version = "1.0.3"
@@ -1295,6 +1579,20 @@ dependencies = [ · 6 unmodified lines
12951579 "tempfile",
12961580 ]
12971581
1582+[[package]]
1583+name = "git-tempfile"
1584+version = "1.0.3"
1585+source = "registry+https://github.com/rust-lang/crates.io-index"
1586+checksum = "046792b44be24ca39889f2a5cf202ca7fbcf96b66392cfbfa406a990219a47ba"
1587+dependencies = [
1588+ "dashmap",
1589+ "libc",
1590+ "once_cell",
1591+ "signal-hook",
1592+ "signal-hook-registry",
1593+ "tempfile",
1594+]
1595+
12981596 [[package]]
12991597 name = "git-testtools"
13001598 version = "0.6.0"
@@ -1302,7 +1600,7 @@ dependencies = [ · 1 unmodified line
13021600 "bstr",
13031601 "crc",
13041602 "fs_extra",
1305− "git-hash",
1603+ "git-hash 0.8.0",
13061604 "nom",
13071605 "once_cell",
13081606 "tempfile",
@@ -1320,10 +1618,10 @@ dependencies = [ · 11 unmodified lines
13201618 "curl",
13211619 "futures-io",
13221620 "futures-lite",
1323− "git-features",
1324− "git-pack",
1325− "git-packetline",
1326− "git-url",
1621+ "git-features 0.18.0",
1622+ "git-pack 0.15.0",
1623+ "git-packetline 0.12.2",
1624+ "git-url 0.3.4",
13271625 "maybe-async",
13281626 "pin-project-lite",
13291627 "quick-error",
@@ -1331,17 +1629,46 @@ dependencies = [ · 1 unmodified line
13311629 "thiserror",
13321630 ]
13331631
1632+[[package]]
1633+name = "git-transport"
1634+version = "0.14.0"
1635+source = "registry+https://github.com/rust-lang/crates.io-index"
1636+checksum = "d549996399b263d3eceb7a2f6f59e78ae85ed150eb9c16187bf4df89f5544331"
1637+dependencies = [
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+
13341650 [[package]]
13351651 name = "git-traverse"
13361652 version = "0.11.0"
13371653 dependencies = [
1338− "git-hash",
1339− "git-object",
1340− "git-odb",
1654+ "git-hash 0.8.0",
1655+ "git-object 0.16.0",
1656+ "git-odb 0.25.0",
13411657 "git-testtools",
13421658 "quick-error",
13431659 ]
13441660
1661+[[package]]
1662+name = "git-traverse"
1663+version = "0.11.0"
1664+source = "registry+https://github.com/rust-lang/crates.io-index"
1665+checksum = "af7e58e22a4038ed047cd480e11a6bb44e5c47d0a5489eb395d773f684f30012"
1666+dependencies = [
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+
13451672 [[package]]
13461673 name = "git-tui"
13471674 version = "0.0.0"
@@ -1357,6 +1684,18 @@ dependencies = [ · 9 unmodified lines
13571684 "url",
13581685 ]
13591686
1687+[[package]]
1688+name = "git-url"
1689+version = "0.3.4"
1690+source = "registry+https://github.com/rust-lang/crates.io-index"
1691+checksum = "866e8deb986b21d4e206d7fa690bac3a5b5072293cae1eeec09c4494f4a4eaaa"
1692+dependencies = [
1693+ "bstr",
1694+ "home",
1695+ "quick-error",
1696+ "url",
1697+]
1698+
13601699 [[package]]
13611700 name = "git-validate"
13621701 version = "0.5.3"
@@ -1366,6 +1705,16 @@ dependencies = [ · 3 unmodified lines
13661705 "quick-error",
13671706 ]
13681707
1708+[[package]]
1709+name = "git-validate"
1710+version = "0.5.3"
1711+source = "registry+https://github.com/rust-lang/crates.io-index"
1712+checksum = "c58bafc6cd6f455a95997c47823182dd62cdb47f03564c44c6b6d910221801dc"
1713+dependencies = [
1714+ "bstr",
1715+ "quick-error",
1716+]
1717+
13691718 [[package]]
13701719 name = "git2"
13711720 version = "0.13.24"
@@ -1392,9 +1741,9 @@ dependencies = [ · 20 unmodified lines
13921741 "crosstermion",
13931742 "env_logger",
13941743 "futures-lite",
1395− "git-features",
1396− "git-repository",
1397− "git-transport",
1744+ "git-features 0.18.0",
1745+ "git-repository 0.13.0",
1746+ "git-transport 0.14.0",
13981747 "gitoxide-core",
13991748 "prodash",
14001749 ]
@@ -1413,10 +1762,10 @@ dependencies = [ · 12 unmodified lines
14131762 "futures-io",
14141763 "futures-lite",
14151764 "git-commitgraph",
1416− "git-config",
1417− "git-pack",
1418− "git-repository",
1419− "git-url",
1765+ "git-config 0.1.9",
1766+ "git-pack 0.15.0",
1767+ "git-repository 0.13.0",
1768+ "git-url 0.3.4",
14201769 "itertools",
14211770 "jwalk",
14221771 "os_str_bytes 3.1.0",
@@ -1520,6 +1869,20 @@ dependencies = [ · 97 unmodified lines
15201869 "unicode-normalization",
15211870 ]
15221871
1872+[[package]]
1873+name = "im"
1874+version = "15.0.0"
1875+source = "registry+https://github.com/rust-lang/crates.io-index"
1876+checksum = "111c1983f3c5bb72732df25cddacee9b546d08325fb584b5ebd38148be7b0246"
1877+dependencies = [
1878+ "bitmaps",
1879+ "rand_core 0.5.1",
1880+ "rand_xoshiro",
1881+ "sized-chunks",
1882+ "typenum",
1883+ "version_check",
1884+]
1885+
15231886 [[package]]
15241887 name = "indexmap"
15251888 version = "1.7.0"
@@ -1659,6 +2022,40 @@ dependencies = [ · 133 unmodified lines
16592022 "vcpkg",
16602023 ]
16612024
2025+[[package]]
2026+name = "link-git"
2027+version = "0.1.0"
2028+source = "git+https://github.com/Byron/radicle-link.git?rev=6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911#6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911"
2029+dependencies = [
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+
16622059 [[package]]
16632060 name = "linked-hash-map"
16642061 version = "0.5.4"
@@ -1832,8 +2229,9 @@ name = "object-access" · 167 unmodified lines
18322229 version = "0.1.0"
18332230 dependencies = [
18342231 "anyhow",
1835− "git-repository",
2232+ "git-repository 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
18362233 "git2",
2234+ "link-git",
18372235 "parking_lot",
18382236 "rayon",
18392237 ]
@@ -1843,10 +2241,10 @@ name = "odb-redesign" · 3 unmodified lines
18432241 version = "0.1.0"
18442242 dependencies = [
18452243 "anyhow",
1846− "git-hash",
1847− "git-odb",
1848− "git-pack",
1849− "git-ref",
2244+ "git-hash 0.8.0",
2245+ "git-odb 0.25.0",
2246+ "git-pack 0.15.0",
2247+ "git-ref 0.10.0",
18502248 "parking_lot",
18512249 "thiserror",
18522250 ]
@@ -1959,6 +2357,26 @@ version = "2.1.0" · 106 unmodified lines
19592357 source = "registry+https://github.com/rust-lang/crates.io-index"
19602358 checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
19612359
2360+[[package]]
2361+name = "pin-project"
2362+version = "1.0.8"
2363+source = "registry+https://github.com/rust-lang/crates.io-index"
2364+checksum = "576bc800220cc65dac09e99e97b08b358cfab6e17078de8dc5fee223bd2d0c08"
2365+dependencies = [
2366+ "pin-project-internal",
2367+]
2368+
2369+[[package]]
2370+name = "pin-project-internal"
2371+version = "1.0.8"
2372+source = "registry+https://github.com/rust-lang/crates.io-index"
2373+checksum = "6e8fe8163d14ce7f0cdac2e040116f22eac817edabff0be91e8aff7e9accf389"
2374+dependencies = [
2375+ "proc-macro2",
2376+ "quote",
2377+ "syn",
2378+]
2379+
19622380 [[package]]
19632381 name = "pin-project-lite"
19642382 version = "0.2.7"
@@ -2060,6 +2478,18 @@ dependencies = [ · 95 unmodified lines
20602478 "version_check",
20612479 ]
20622480
2481+[[package]]
2482+name = "proc-macro-hack"
2483+version = "0.5.19"
2484+source = "registry+https://github.com/rust-lang/crates.io-index"
2485+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
2486+
2487+[[package]]
2488+name = "proc-macro-nested"
2489+version = "0.1.7"
2490+source = "registry+https://github.com/rust-lang/crates.io-index"
2491+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
2492+
20632493 [[package]]
20642494 name = "proc-macro2"
20652495 version = "1.0.32"
@@ -2128,7 +2558,7 @@ checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" · 62 unmodified lines
21282558 dependencies = [
21292559 "libc",
21302560 "rand_chacha",
2131− "rand_core",
2561+ "rand_core 0.6.3",
21322562 "rand_hc",
21332563 ]
21342564
@@ -2139,9 +2569,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" · 4 unmodified lines
21392569 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
21402570 dependencies = [
21412571 "ppv-lite86",
2142− "rand_core",
2572+ "rand_core 0.6.3",
21432573 ]
21442574
2575+[[package]]
2576+name = "rand_core"
2577+version = "0.5.1"
2578+source = "registry+https://github.com/rust-lang/crates.io-index"
2579+checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
2580+
21452581 [[package]]
21462582 name = "rand_core"
21472583 version = "0.6.3"
@@ -2157,7 +2593,16 @@ version = "0.3.1" · 9 unmodified lines
21572593 source = "registry+https://github.com/rust-lang/crates.io-index"
21582594 checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
21592595 dependencies = [
2160− "rand_core",
2596+ "rand_core 0.6.3",
2597+]
2598+
2599+[[package]]
2600+name = "rand_xoshiro"
2601+version = "0.4.0"
2602+source = "registry+https://github.com/rust-lang/crates.io-index"
2603+checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
2604+dependencies = [
2605+ "rand_core 0.5.1",
21612606 ]
21622607
21632608 [[package]]
@@ -2243,6 +2688,12 @@ dependencies = [ · 79 unmodified lines
22432688 "winapi",
22442689 ]
22452690
2691+[[package]]
2692+name = "rustc-hash"
2693+version = "1.1.0"
2694+source = "registry+https://github.com/rust-lang/crates.io-index"
2695+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
2696+
22462697 [[package]]
22472698 name = "rustc_version"
22482699 version = "0.4.0"
@@ -2432,6 +2883,16 @@ version = "1.3.0" · 183 unmodified lines
24322883 source = "registry+https://github.com/rust-lang/crates.io-index"
24332884 checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
24342885
2886+[[package]]
2887+name = "sized-chunks"
2888+version = "0.6.5"
2889+source = "registry+https://github.com/rust-lang/crates.io-index"
2890+checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e"
2891+dependencies = [
2892+ "bitmaps",
2893+ "typenum",
2894+]
2895+
24352896 [[package]]
24362897 name = "slab"
24372898 version = "0.4.5"
@@ -2638,13 +3099,45 @@ dependencies = [ · 200 unmodified lines
26383099 "linked-hash-map",
26393100 ]
26403101
3102+[[package]]
3103+name = "tracing"
3104+version = "0.1.29"
3105+source = "registry+https://github.com/rust-lang/crates.io-index"
3106+checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105"
3107+dependencies = [
3108+ "cfg-if",
3109+ "pin-project-lite",
3110+ "tracing-attributes",
3111+ "tracing-core",
3112+]
3113+
3114+[[package]]
3115+name = "tracing-attributes"
3116+version = "0.1.18"
3117+source = "registry+https://github.com/rust-lang/crates.io-index"
3118+checksum = "f4f480b8f81512e825f337ad51e94c1eb5d3bbdf2b363dcd01e2b19a9ffe3f8e"
3119+dependencies = [
3120+ "proc-macro2",
3121+ "quote",
3122+ "syn",
3123+]
3124+
3125+[[package]]
3126+name = "tracing-core"
3127+version = "0.1.21"
3128+source = "registry+https://github.com/rust-lang/crates.io-index"
3129+checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4"
3130+dependencies = [
3131+ "lazy_static",
3132+]
3133+
26413134 [[package]]
26423135 name = "traversal"
26433136 version = "0.1.0"
26443137 dependencies = [
26453138 "anyhow",
26463139 "dashmap",
2647− "git-repository",
3140+ "git-repository 0.13.0",
26483141 "git2",
26493142 "rayon",
26503143 ]
@@ -2778,6 +3271,16 @@ version = "0.9.3" · 127 unmodified lines
27783271 source = "registry+https://github.com/rust-lang/crates.io-index"
27793272 checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
27803273
3274+[[package]]
3275+name = "versions"
3276+version = "3.0.3"
3277+source = "registry+https://github.com/rust-lang/crates.io-index"
3278+checksum = "5cd9a7a22c45daf5aeb6bea3dff4ecbb8eb43e492582d467b18ce2979b512cbe"
3279+dependencies = [
3280+ "itertools",
3281+ "nom",
3282+]
3283+
27813284 [[package]]
27823285 name = "waker-fn"
27833286 version = "1.1.0"
experiments/object-access/Cargo.toml+5−1
@@ -7,9 +7,13 @@ publish = false · 6 unmodified lines
77
88 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
99
10+[features]
11+radicle-nightly = ["link-git"]
12+
1013 [dependencies]
1114 anyhow = "1"
12−git-repository = { version ="^0.13.0", path = "../../git-repository", features = ["unstable"] }
15+git-repository = { version ="^0.13.0", features = ["unstable"] }
1316 git2 = "0.13"
17+link-git = { git = "https://github.com/Byron/radicle-link.git", rev = "6c9ad7aeadcf2b04f87cc01c9825c472c3ba0911", optional = true }
1418 rayon = "1.5.0"
1519 parking_lot = { version = "0.11.0", default-features = false }
experiments/object-access/src/main.rs+71−1
@@ -1,7 +1,7 @@
11 use std::{path::Path, sync::Arc, time::Instant};
22
33 use anyhow::anyhow;
4−use git_repository::{hash::ObjectId, odb, prelude::*, Repository};
4+use git_repository::{hash::ObjectId, odb, Repository};
55
66 const GITOXIDE_STATIC_CACHE_SIZE: usize = 64;
77 const GITOXIDE_CACHED_OBJECT_DATA_PER_THREAD_IN_BYTES: usize = 60_000_000;
@@ -32,6 +32,19 @@ fn main() -> anyhow::Result<()> { · 24 unmodified lines
3232 objs_per_sec(elapsed)
3333 );
3434
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+
3548 let start = Instant::now();
3649 let bytes = do_gitoxide_in_parallel_through_arc(
3750 &hashes,
@@ -47,6 +60,19 @@ fn main() -> anyhow::Result<()> { · 9 unmodified lines
4760 objs_per_sec(elapsed)
4861 );
4962
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+
5076 let start = Instant::now();
5177 do_gitoxide_in_parallel_through_arc(
5278 &hashes,
@@ -230,6 +256,7 @@ fn do_gitoxide<C>(hashes: &[ObjectId], repo: &Repository, new_cache: impl FnOnce · 177 unmodified lines
230256 where
231257 C: odb::pack::cache::DecodeEntry,
232258 {
259+ use git_repository::prelude::FindExt;
233260 let mut buf = Vec::new();
234261 let mut bytes = 0u64;
235262 let mut cache = new_cache();
@@ -254,6 +281,7 @@ fn do_gitoxide_in_parallel<C>( · 18 unmodified lines
254281 where
255282 C: odb::pack::cache::DecodeEntry,
256283 {
284+ use git_repository::prelude::FindExt;
257285 use rayon::prelude::*;
258286 let bytes = std::sync::atomic::AtomicU64::default();
259287 hashes.par_iter().try_for_each_init::<_, _, _, anyhow::Result<_>>(
@@ -275,6 +303,46 @@ where · 15 unmodified lines
275303 Ok(bytes.load(std::sync::atomic::Ordering::Acquire))
276304 }
277305
306+/// A fully sync implementation but with interior mutability
307+#[cfg(feature = "radicle-nightly")]
308+fn 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>
314+where
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+
278346 fn do_gitoxide_in_parallel_through_arc<C>(
279347 hashes: &[ObjectId],
280348 repo: &Path,
@@ -284,6 +352,7 @@ fn do_gitoxide_in_parallel_through_arc<C>( · 3 unmodified lines
284352 where
285353 C: odb::pack::cache::DecodeEntry,
286354 {
355+ use git_repository::prelude::FindExt;
287356 let bytes = std::sync::atomic::AtomicU64::default();
288357 let odb = Arc::new(git_repository::odb::linked::Store::at(repo)?);
289358
@@ -319,6 +388,7 @@ fn do_gitoxide_in_parallel_through_arc_rw_lock<C>( · 29 unmodified lines
319388 where
320389 C: odb::pack::cache::DecodeEntry,
321390 {
391+ use git_repository::prelude::FindExt;
322392 let bytes = std::sync::atomic::AtomicU64::default();
323393 let odb = Arc::new(parking_lot::RwLock::new(git_repository::odb::linked::Store::at(repo)?));
324394