Skip to content

Commit

Permalink
chore: update drun to a more recent version (#4348)
Browse files Browse the repository at this point in the history
Based on `IC` release 2023-12-13.

Adjustments for `nix` build:
* Fix revisions for `ic-btc` dependencies, see dfinity/ic#124
* Patch `rocksdb` to build on MacOS `darwin`.

IC new metering has an effect on the benchmark results.
  • Loading branch information
luc-blaeser authored Jan 10, 2024
1 parent b412a4b commit bd6bfa3
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 54 deletions.
27 changes: 13 additions & 14 deletions nix/drun.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,28 @@ pkgs:
cargoLock = {
lockFile = "${pkgs.sources.ic}/Cargo.lock";
outputHashes = {
"build-info-0.0.27" = "sha256-SkwWwDNrTsntkNiCv6rsyTFGazhpRDnKtVzPpYLKF9U=";
"derive_more-0.99.8-alpha.0" = "sha256-tEsfYC9oCAsDjinCsUDgRg3q6ruvayuA1lRmsEP9cys=";
"ic-btc-interface-0.1.0" = "sha256-VecEMFjoeiRi0VgJ9CeDoOzdyJbJNiZ5MBmiV1+b7As=";
"ic-btc-interface-0.1.0" = "sha256-JoVg1t62C2FIe0la1oQzidybLj1CyAQy80gkRh/MTn0=";
"ic-btc-test-utils-0.1.0" = "sha256-VecEMFjoeiRi0VgJ9CeDoOzdyJbJNiZ5MBmiV1+b7As=";
"icrc1-test-env-0.1.1" = "sha256-yWJF+KM8l65Nr0pwR9QeltkqbHDzOLNPVnLhf1mRukQ=";
"jsonrpc-0.12.1" = "sha256-3FtdZlt2PqVDkE5iKWYIp1eiIELsaYlUPRSP2Xp8ejM=";
"libssh2-sys-0.2.23" = "sha256-9Hb7CnPF+lxrVO1NAhS7EXcPVWZutJXr6UWxpptzk4U=";
"lmdb-rkv-0.14.99" = "sha256-dqxWgtNZ/qRukQLiDawjHRwdPgfzm/sVcWwudwX9rD8=";
"pprof-0.10.1" = "sha256-ioZ8AyFTUUev8MDZapto0yXC6G+dZzg+7ZNtTR87Rg4=";
"lmdb-rkv-0.14.99" = "sha256-5WcUzapkrc/s3wCBNCuUDhtbp17n67rTbm2rx0qtITg=";
};
};

patchPhase = ''
cd ../cargo-vendor-dir
patch librocksdb-sys*/build.rs << EOF
@@ -118,6 +118,10 @@
config.define("OS_MACOSX", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
config.define("ROCKSDB_LIB_IO_POSIX", Some("1"));
+ if target.contains("aarch64") {
+ config.define("isSSE42()", Some("0"));
+ config.define("isPCLMULQDQ()", Some("0"));
+ }
} else if target.contains("android") {
config.define("OS_ANDROID", Some("1"));
config.define("ROCKSDB_PLATFORM_POSIX", Some("1"));
@@ -249,6 +249,9 @@ fn build_rocksdb() {
config.flag("-Wno-missing-field-initializers");
config.flag("-Wno-strict-aliasing");
config.flag("-Wno-invalid-offsetof");
+ if target.contains("darwin") {
+ config.flag("-faligned-allocation");
+ }
}
EOF
cd -
Expand Down
9 changes: 4 additions & 5 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@
"version": "3.2.25"
},
"ic": {
"branch": "pull/124/head",
"builtin": false,
"branch": "pull/153/head",
"description": "Internet Computer blockchain source: the client/replica software run by nodes",
"homepage": "",
"owner": "dfinity",
"repo": "ic",
"rev": "aa293129bce86f46cc34bb25ed50f0edb924a501",
"sha256": "1z5azm0b2kb76mrigqb6i81hb2mh8psp4ffragvsyqa242rl0yrc",
"rev": "64f807484924c38cdfda49970e0bb21321564fe2",
"sha256": "18sk96zqg79p08z0wsn5bsxsw3aps26si7n76av7inlc4sfvvm4a",
"type": "tarball",
"url": "https://github.com/dfinity/ic/archive/aa293129bce86f46cc34bb25ed50f0edb924a501.tar.gz",
"url": "https://github.com/dfinity/ic/archive/64f807484924c38cdfda49970e0bb21321564fe2.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"ic-hs": {
Expand Down
6 changes: 3 additions & 3 deletions test/bench/ok/alloc.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_399_375_662)
debug.print: (+268_435_456, 3_004_768_607)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_399_195_438)
debug.print: (+268_435_456, 3_003_285_855)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_399_195_438)
debug.print: (+268_435_456, 3_003_285_855)
ingress Completed: Reply: 0x4449444c0000
6 changes: 3 additions & 3 deletions test/bench/ok/alloc.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_432_999_739)
debug.print: (+268_435_456, 3_071_992_190)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_432_799_035)
debug.print: (+268_435_456, 3_070_484_862)
ingress Completed: Reply: 0x4449444c0000
debug.print: (+268_435_456, 2_432_799_035)
debug.print: (+268_435_456, 3_070_484_862)
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/bignum.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 2_389_399; size = +59_652}
debug.print: {cycles = 2_512_727; size = +59_652}
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 102_989_440; size = +1_817_872}
debug.print: {cycles = 107_695_001; size = +1_817_872}
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/bignum.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 2_493_575; size = +59_652}
debug.print: {cycles = 2_619_860; size = +59_652}
ingress Completed: Reply: 0x4449444c0000
debug.print: {cycles = 103_046_430; size = +1_817_872}
debug.print: {cycles = 107_889_964; size = +1_817_872}
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/heap-32.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (50_227, +30_261_252, 620_249_054)
debug.print: (50_070, +32_992_212, 671_159_894)
debug.print: (50_227, +30_261_252, 709_322_975)
debug.print: (50_070, +32_992_212, 766_414_006)
ingress Completed: Reply: 0x4449444c0000
4 changes: 2 additions & 2 deletions test/bench/ok/heap-32.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (50_227, +30_261_252, 667_502_508)
debug.print: (50_070, +32_992_212, 720_277_315)
debug.print: (50_227, +30_261_252, 770_048_232)
debug.print: (50_070, +32_992_212, 830_127_686)
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/nat16.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (0, 18_875_142)
debug.print: (0, 22_021_111)
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/nat16.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (0, 42_992_115)
debug.print: (0, 51_380_884)
ingress Completed: Reply: 0x4449444c0000
12 changes: 6 additions & 6 deletions test/bench/ok/palindrome.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (true, +1_188, 10_601)
debug.print: (false, +1_188, 9_947)
debug.print: (false, +1_188, 10_592)
debug.print: (true, +868, 10_944)
debug.print: (false, +868, 9_878)
debug.print: (false, +868, 10_913)
debug.print: (true, +1_188, 11_397)
debug.print: (false, +1_188, 10_492)
debug.print: (false, +1_188, 11_377)
debug.print: (true, +868, 11_593)
debug.print: (false, +868, 10_164)
debug.print: (false, +868, 11_544)
ingress Completed: Reply: 0x4449444c0000
12 changes: 6 additions & 6 deletions test/bench/ok/palindrome.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: (true, +1_188, 11_633)
debug.print: (false, +1_188, 10_933)
debug.print: (false, +1_188, 11_623)
debug.print: (true, +868, 11_595)
debug.print: (false, +868, 10_493)
debug.print: (false, +868, 11_558)
debug.print: (true, +1_188, 12_673)
debug.print: (false, +1_188, 11_722)
debug.print: (false, +1_188, 12_652)
debug.print: (true, +868, 12_781)
debug.print: (false, +868, 11_244)
debug.print: (false, +868, 12_729)
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region-mem.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 5_096_079_643}
debug.print: {heap_diff = 0; instr_diff = 5_662_310_732}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 5_372_903_723}
debug.print: {heap_diff = 0; instr_diff = 5_964_300_653}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region0-mem.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 5_221_908_763}
debug.print: {heap_diff = 0; instr_diff = 5_838_471_500}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/region0-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 5_624_561_963}
debug.print: {heap_diff = 0; instr_diff = 6_392_119_661}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/stable-mem.drun-run-opt.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 2_642_411_803}
debug.print: {heap_diff = 0; instr_diff = 3_510_632_780}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/bench/ok/stable-mem.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: {heap_diff = 0; instr_diff = 2_982_150_443}
debug.print: {heap_diff = 0; instr_diff = 3_875_537_261}
ingress Completed: Reply: 0x4449444c0000
2 changes: 1 addition & 1 deletion test/run-drun/ok/perf.drun-run.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101
ingress Completed: Reply: 0x4449444c0000
debug.print: 50_218
debug.print: 66_251
ingress Completed: Reply: 0x4449444c0000

0 comments on commit bd6bfa3

Please sign in to comment.