diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..d5135e9 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustflags = ["-C", "target-cpu=native"] \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index d8ec42d..8e59626 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,19 @@ dependencies = [ "pretty", ] +[[package]] +name = "agnostik" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0b98a97b13a75d90ab4abfcdb5268330c8392ab03a357bdab0fa9c36ccb1c6a" +dependencies = [ + "bastion-executor", + "cfg_aliases", + "lightproc", + "once_cell", + "pin-project", +] + [[package]] name = "ahash" version = "0.7.4" @@ -70,6 +83,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anyhow" +version = "1.0.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1" + [[package]] name = "arrayref" version = "0.3.6" @@ -132,7 +151,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2", + "socket2 0.4.1", "waker-fn", "winapi", ] @@ -146,6 +165,15 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-mutex" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" +dependencies = [ + "event-listener", +] + [[package]] name = "async-net" version = "1.6.1" @@ -229,6 +257,61 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bastion" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98f4436af3631317f6c36e5b689eed30f262c60eb69fb769007f06f3b76b7173" +dependencies = [ + "anyhow", + "async-mutex", + "bastion-executor", + "crossbeam-queue", + "futures 0.3.16", + "futures-timer 3.0.2", + "fxhash", + "lazy_static", + "lever", + "lightproc", + "nuclei", + "pin-utils", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", + "uuid", +] + +[[package]] +name = "bastion-executor" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27dc6c4dc1295a173dd6043f87cd7c27245802cfecc8ad7b929760d73e193f5a" +dependencies = [ + "arrayvec", + "bastion-utils", + "crossbeam-channel", + "crossbeam-epoch 0.9.5", + "crossbeam-queue", + "crossbeam-utils 0.8.5", + "futures-timer 3.0.2", + "lazy_static", + "lever", + "libc", + "lightproc", + "num_cpus", + "once_cell", + "pin-utils", + "tracing", + "winapi", +] + +[[package]] +name = "bastion-utils" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271e48689ed6b78f7275193b86537764739174d5856e20d25e63f731218af379" + [[package]] name = "bincode" version = "1.3.3" @@ -425,6 +508,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" version = "0.4.19" @@ -496,6 +585,65 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.5", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.5", + "lazy_static", + "memoffset 0.6.4", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b10ddc024425c88c2ad148c1b0fd53f4c6d38db9697c9f1588381212fa657c9" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.5", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static", +] + [[package]] name = "crossbeam-utils" version = "0.8.5" @@ -557,6 +705,7 @@ version = "0.3.0" dependencies = [ "async-oneshot", "async-trait", + "bastion", "bincode", "capnp", "capnp-futures", @@ -570,6 +719,7 @@ dependencies = [ "lazy_static", "libc", "lmdb-rkv", + "nuclei", "paho-mqtt", "ptr_meta", "rand", @@ -885,6 +1035,12 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.16" @@ -922,6 +1078,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -1096,6 +1261,22 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +[[package]] +name = "lever" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4894ef6dbd1b26dbd7284530c227aab005a57b939427ace2d4d0cc62c23fb05b" +dependencies = [ + "anyhow", + "crossbeam-epoch 0.8.2", + "itertools", + "lazy_static", + "log", + "parking_lot", + "slice-group-by", + "thiserror", +] + [[package]] name = "lexical-core" version = "0.7.6" @@ -1125,6 +1306,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "lightproc" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebf7c202c4da35d579058d845fad7b62d3aff5fcb10c5a57fc175ac632874de0" +dependencies = [ + "crossbeam-utils 0.7.2", + "pin-utils", +] + [[package]] name = "lmdb-rkv" version = "0.14.0" @@ -1148,6 +1339,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "lock_api" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +dependencies = [ + "scopeguard", +] + [[package]] name = "log" version = "0.4.14" @@ -1178,12 +1378,36 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "memchr" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memoffset" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +dependencies = [ + "autocfg", +] + [[package]] name = "nom" version = "5.1.2" @@ -1195,6 +1419,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "nuclei" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c3a307258c4f4b95032a559cffef7b968cc2213e64b8a3a4738a101d7c7eff" +dependencies = [ + "agnostik", + "futures 0.3.16", + "futures-io", + "futures-util", + "lever", + "libc", + "once_cell", + "pin-utils", + "socket2 0.3.19", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1248,7 +1489,7 @@ version = "0.8.0" source = "git+https://github.com/dequbed/paho.mqtt.rust.git?branch=master#14ec804ecf284564ee71b04345d1fdf1f75571df" dependencies = [ "futures 0.3.16", - "futures-timer", + "futures-timer 0.3.0", "libc", "log", "paho-mqtt-sys", @@ -1270,6 +1511,31 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +dependencies = [ + "cfg-if 1.0.0", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -1652,7 +1918,7 @@ dependencies = [ "base64", "blake2b_simd", "constant_time_eq", - "crossbeam-utils", + "crossbeam-utils 0.8.5", ] [[package]] @@ -1676,6 +1942,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + [[package]] name = "seahash" version = "4.1.0" @@ -1801,6 +2073,12 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +[[package]] +name = "slice-group-by" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f7474f0b646d228360ab62ed974744617bc869d959eac8403bfa3665931a7fb" + [[package]] name = "smallvec" version = "1.7.0" @@ -1825,6 +2103,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "socket2" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.4.1" diff --git a/Cargo.toml b/Cargo.toml index ccc5e87..8eb2b47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,14 +6,16 @@ authors = [ "dequbed " , "Joseph Langosch " , "Jannis Rieger " ] -license = "GPL-3.0" +license = "LGPL-3.0" edition = "2018" -[features] -default = ["lmdb"] +[profile.dev] +lto = "thin" -# Use LMDB for internal kv-stores -lmdb = [] +[profile.release] +opt-level = 3 +debug = true +lto = "thin" [dependencies] libc = "0.2.101" @@ -75,4 +77,4 @@ walkdir = "2.3.2" [dev-dependencies] futures-test = "0.3.16" tempfile = "3.2" -bincode = "1.3" +bincode = "1.3" \ No newline at end of file