diff --git a/cozo-core/Cargo.toml b/cozo-core/Cargo.toml
index 713397a5..79b88f25 100644
--- a/cozo-core/Cargo.toml
+++ b/cozo-core/Cargo.toml
@@ -17,7 +17,7 @@ exclude = [
default = ["compact"]
## Enables the `minimal`, `requests` and `graph-algo` features.
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode.
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature.
@@ -33,7 +33,7 @@ storage-sqlite = ["dep:sqlite", "dep:sqlite3-src"]
## You can also [fine-tune](https://github.com/cozodb/cozo/blob/main/TUNING_ROCKSDB.md) RocksDB options.
storage-rocksdb = ["dep:cozorocks"]
## Enables the graph algorithms.
-graph-algo = []
+graph-algo = ["graph", "rayon"]
## Allows the utilities to make web requests to fetch data.
requests = ["dep:minreq"]
## Uses jemalloc as the global allocator, can make a difference in performance.
@@ -42,10 +42,6 @@ jemalloc = ["dep:tikv-jemallocator-global", "cozorocks?/jemalloc"]
io-uring = ["cozorocks?/io-uring"]
## Polyfills for the WASM target
wasm = ["uuid/js", "dep:js-sys"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms.
-rayon = ["dep:rayon", "dep:graph"]
-## Disallows the use of threads.
-nothread = []
#! The following features are highly experimental:
@@ -67,12 +63,6 @@ storage-tikv = ["dep:tikv-client", "dep:tokio"]
#! (utilities are still available),
#! which could be OK if you only want to deal with pure Datalog.
#!
-#! If having multiple threads
-#! running in the background is undesirable, you can enable the `nothread` feature.
-#!
-#! The `rayon` feature enables some algorithms to make use of parallelism. This is desirable in most circumstances.
-#! Naturally, it is incompatible with `nothread`.
-#!
#! The `requests` feature allows the database to make outgoing HTTP requests to fetch data
#! into queries -- only enable it if you need it.
#!
diff --git a/cozo-core/src/data/functions.rs b/cozo-core/src/data/functions.rs
index 891a818e..a1190eda 100644
--- a/cozo-core/src/data/functions.rs
+++ b/cozo-core/src/data/functions.rs
@@ -13,7 +13,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
use chrono::{DateTime, TimeZone, Utc};
use itertools::Itertools;
-#[cfg(feature = "wasm")]
+#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
use js_sys::Date;
use miette::{bail, ensure, miette, Result};
use num_traits::FloatConst;
@@ -1462,12 +1462,12 @@ pub(crate) fn op_to_uuid(args: &[DataValue]) -> Result {
let (q_res, q_cleanups) = self.run_query(&mut tx, p)?;
res = q_res;
cleanups.extend(q_cleanups);
- #[cfg(not(feature = "wasm"))]
+ #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
if let Some(secs) = sleep_opt {
thread::sleep(Duration::from_micros((secs * 1000000.) as u64));
}
@@ -867,15 +867,15 @@ impl<'s, S: Storage<'s>> Db {
let id = self.queries_count.fetch_add(1, Ordering::AcqRel);
// time the query
- #[cfg(not(feature = "wasm"))]
+ #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
let now = SystemTime::now();
- #[cfg(not(feature = "wasm"))]
+ #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
let since_the_epoch = now
.duration_since(UNIX_EPOCH)
.into_diagnostic()?
.as_secs_f64();
- #[cfg(feature = "wasm")]
+ #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
let since_the_epoch = js_sys::Date::now();
let handle = RunningQueryHandle {
@@ -1151,11 +1151,11 @@ impl Poison {
}
Ok(())
}
- #[cfg(feature = "nothread")]
+ #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
pub(crate) fn set_timeout(&self, _secs: f64) -> Result<()> {
bail!("Cannot set timeout when threading is disallowed");
}
- #[cfg(not(feature = "nothread"))]
+ #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
pub(crate) fn set_timeout(&self, secs: f64) -> Result<()> {
let pill = self.clone();
thread::spawn(move || {
diff --git a/cozo-core/src/storage/mem.rs b/cozo-core/src/storage/mem.rs
index 01686feb..cdd2ba56 100644
--- a/cozo-core/src/storage/mem.rs
+++ b/cozo-core/src/storage/mem.rs
@@ -67,9 +67,9 @@ impl<'s> Storage<'s> for MemStorage {
wtr.remove(k);
}
};
- #[cfg(feature = "nothread")]
+ #[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
closure();
- #[cfg(not(feature = "nothread"))]
+ #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
std::thread::spawn(closure);
Ok(())
}
diff --git a/cozo-core/src/storage/sqlite.rs b/cozo-core/src/storage/sqlite.rs
index 16f5b013..44343fb7 100644
--- a/cozo-core/src/storage/sqlite.rs
+++ b/cozo-core/src/storage/sqlite.rs
@@ -108,9 +108,6 @@ impl<'s> Storage<'s> for SqliteStorage {
statement.bind((2, &upper_b as &[u8])).unwrap();
while statement.next().unwrap() != State::Done {}
};
- #[cfg(feature = "nothread")]
- closure();
- #[cfg(not(feature = "nothread"))]
std::thread::spawn(closure);
Ok(())
}
diff --git a/cozo-lib-c/Cargo.toml b/cozo-lib-c/Cargo.toml
index cefafe14..85b38dd1 100644
--- a/cozo-lib-c/Cargo.toml
+++ b/cozo-lib-c/Cargo.toml
@@ -15,9 +15,9 @@ crate-type = ["cdylib", "staticlib"]
#! # Features
## Enables the `minimal`, `requests` and `graph-algo` features
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` and `graph-algo` features
-mobile = ["storage-sqlite", "graph-algo", "rayon"]
+mobile = ["storage-sqlite", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature
@@ -34,10 +34,6 @@ requests = ["cozo/requests"]
jemalloc = ["cozo/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["cozo/io-uring"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms
-rayon = ["cozo/rayon"]
-## Disallows the use of threads
-nothread = ["cozo/nothread"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/cozo-lib-java/Cargo.toml b/cozo-lib-java/Cargo.toml
index e6bc5854..62848e21 100644
--- a/cozo-lib-java/Cargo.toml
+++ b/cozo-lib-java/Cargo.toml
@@ -15,9 +15,9 @@ crate-type = ["cdylib"]
#! # Features
## Enables the `minimal`, `requests` and `graph-algo` features
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` and `graph-algo` features
-mobile = ["storage-sqlite", "graph-algo", "rayon"]
+mobile = ["storage-sqlite", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature
@@ -34,10 +34,6 @@ requests = ["cozo/requests"]
jemalloc = ["cozo/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["cozo/io-uring"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms
-rayon = ["cozo/rayon"]
-## Disallows the use of threads
-nothread = ["cozo/nothread"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/cozo-lib-nodejs/Cargo.toml b/cozo-lib-nodejs/Cargo.toml
index 1b86a7ef..36ea50ab 100644
--- a/cozo-lib-nodejs/Cargo.toml
+++ b/cozo-lib-nodejs/Cargo.toml
@@ -17,9 +17,9 @@ crate-type = ["cdylib"]
#! # Features
## Enables the `minimal`, `requests` and `graph-algo` features
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` and `graph-algo` features
-mobile = ["storage-sqlite", "graph-algo", "rayon"]
+mobile = ["storage-sqlite", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature
@@ -36,10 +36,6 @@ requests = ["cozo/requests"]
jemalloc = ["cozo/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["cozo/io-uring"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms
-rayon = ["cozo/rayon"]
-## Disallows the use of threads
-nothread = ["cozo/nothread"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/cozo-lib-python/Cargo.toml b/cozo-lib-python/Cargo.toml
index e0211e32..f93110e7 100644
--- a/cozo-lib-python/Cargo.toml
+++ b/cozo-lib-python/Cargo.toml
@@ -19,9 +19,9 @@ crate-type = ["cdylib"]
#! # Features
## Enables the `minimal`, `requests` and `graph-algo` features
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` and `graph-algo` features
-mobile = ["storage-sqlite", "graph-algo", "rayon"]
+mobile = ["storage-sqlite", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature
@@ -38,10 +38,6 @@ requests = ["cozo/requests"]
jemalloc = ["cozo/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["cozo/io-uring"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms
-rayon = ["cozo/rayon"]
-## Disallows the use of threads
-nothread = ["cozo/nothread"]
[dependencies]
diff --git a/cozo-lib-swift/Cargo.toml b/cozo-lib-swift/Cargo.toml
index b43f3d4e..8dd71ea8 100644
--- a/cozo-lib-swift/Cargo.toml
+++ b/cozo-lib-swift/Cargo.toml
@@ -16,9 +16,9 @@ crate-type = ["staticlib"]
[features]
## Enables the `minimal`, `requests` and `graph-algo` features
-compact = ["minimal", "requests", "graph-algo", "rayon"]
+compact = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` and `graph-algo` features
-mobile = ["storage-sqlite", "graph-algo", "rayon"]
+mobile = ["storage-sqlite", "graph-algo"]
## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode
compact-single-threaded = ["minimal", "requests", "graph-algo"]
## Enables the `storage-sqlite` feature
@@ -35,10 +35,6 @@ requests = ["cozo/requests"]
jemalloc = ["cozo/jemalloc"]
## Enables io-uring option for the RocksDB storage
io-uring = ["cozo/io-uring"]
-## Allows threading and enables the use of the `rayon` library for parallelizing algorithms
-rayon = ["cozo/rayon"]
-## Disallows the use of threads
-nothread = ["cozo/nothread"]
[build-dependencies]
swift-bridge-build = "0.1.41"
diff --git a/cozo-lib-wasm/Cargo.toml b/cozo-lib-wasm/Cargo.toml
index 5dac9155..22ff7f99 100644
--- a/cozo-lib-wasm/Cargo.toml
+++ b/cozo-lib-wasm/Cargo.toml
@@ -17,7 +17,7 @@ default = ["console_error_panic_hook"]
[dependencies]
wasm-bindgen = "0.2.63"
-cozo = { version = "0.2.1", path = "../cozo-core", default-features = false, features = ["wasm", "nothread"] }
+cozo = { version = "0.2.1", path = "../cozo-core", default-features = false, features = ["wasm"] }
# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
diff --git a/cozo-lib-wasm/wasm-react-demo/src/App.js b/cozo-lib-wasm/wasm-react-demo/src/App.js
index 25f653dc..fde0ef02 100644
--- a/cozo-lib-wasm/wasm-react-demo/src/App.js
+++ b/cozo-lib-wasm/wasm-react-demo/src/App.js
@@ -225,20 +225,17 @@ function App() {
more information about the Cozo database.
... and run the script, to compute the PageRank of + href="https://en.wikipedia.org/wiki/Transitive_closure">transitive closure of a hypothetical love triangle.
diff --git a/cozoserver/Cargo.toml b/cozoserver/Cargo.toml index 8915f8ed..3fbe4662 100644 --- a/cozoserver/Cargo.toml +++ b/cozoserver/Cargo.toml @@ -15,9 +15,9 @@ documentation = "https://cozodb.github.io/current/manual" #! # Features ## Enables the `minimal`, `requests` and `graph-algo` features -compact = ["minimal", "requests", "graph-algo", "rayon"] +compact = ["minimal", "requests", "graph-algo"] ## Enables the `storage-sqlite` and `graph-algo` features -mobile = ["storage-sqlite", "graph-algo", "rayon"] +mobile = ["storage-sqlite", "graph-algo"] ## Enables the `minimal`, `requests` and `graph-algo` features in single threaded mode compact-single-threaded = ["minimal", "requests", "graph-algo"] ## Enables the `storage-sqlite` feature @@ -34,10 +34,6 @@ requests = ["cozo/requests"] jemalloc = ["cozo/jemalloc"] ## Enables io-uring option for the RocksDB storage io-uring = ["cozo/io-uring"] -## Allows threading and enables the use of the `rayon` library for parallelizing algorithms -rayon = ["cozo/rayon"] -## Disallows the use of threads -nothread = ["cozo/nothread"] ## Enables the [Sled](https://github.com/spacejam/sled) backend storage-sled = ["cozo/storage-sled"] ## Enables the [TiKV](https://tikv.org/) client backend