Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ updates:
- "quote-use*"
random:
patterns:
- "ahash"
- "getrandom"
- "mt19937"
- "rand*"
Expand Down
28 changes: 12 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ ruff_source_file = { package = "rustpython-ruff_source_file", version = "0.15.8"
der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
phf = { version = "0.13.1", default-features = false, features = ["macros"]}
adler32 = "1.2.0"
ahash = "0.8.12"
approx = "0.5.1"
ascii = "1.1"
aws-lc-rs = "1.16.3"
Expand Down Expand Up @@ -260,6 +259,7 @@ quote = "1.0.45"
radium = "1.1.1"
rand = "0.9"
rand_core = { version = "0.9", features = ["os_rng"] }
rapidhash = "4.4.1"
result-like = "0.5.0"
rustix = { version = "1.1", features = ["event", "param", "system"] }
rustls = { version = "0.23.39", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
ruff_python_ast = { workspace = true }
ruff_text_size = { workspace = true }

ahash = { workspace = true }
bitflags = { workspace = true }
indexmap = { workspace = true }
itertools = { workspace = true }

Check warning on line 24 in crates/codegen/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_feature_dependency

dependency `itertools` only used in features
log = { workspace = true }
num-complex = { workspace = true }
num-traits = { workspace = true }
thiserror = { workspace = true }
malachite-bigint = { workspace = true }
memchr = { workspace = true }
rapidhash = { workspace = true }
unicode_names2 = { workspace = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ extern crate log;

extern crate alloc;

type IndexMap<K, V> = indexmap::IndexMap<K, V, ahash::RandomState>;
type IndexSet<T> = indexmap::IndexSet<T, ahash::RandomState>;
type IndexMap<K, V> = indexmap::IndexMap<K, V, rapidhash::quality::RandomState>;
type IndexSet<T> = indexmap::IndexSet<T, rapidhash::quality::RandomState>;

pub mod compile;
pub mod error;
Expand Down
2 changes: 1 addition & 1 deletion crates/stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
ruff_text_size = { workspace = true }
ruff_source_file = { workspace = true }

ahash = { workspace = true }
ascii = { workspace = true }
crossbeam-utils = { workspace = true }
flame = { workspace = true, optional = true }
Expand All @@ -51,6 +50,7 @@
num_enum = { workspace = true }
parking_lot = { workspace = true }
phf = { workspace = true, default-features = true, features = ["macros"] }
rapidhash = { workspace = true }

memchr = { workspace = true }
base64 = { workspace = true }
Expand Down Expand Up @@ -91,7 +91,7 @@

# tkinter
tk-sys = { workspace = true, optional = true }
tcl-sys = { workspace = true, optional = true }

Check warning on line 94 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `tcl-sys`
widestring = { workspace = true, optional = true }
chrono.workspace = true

Expand All @@ -116,8 +116,8 @@
rustls = { workspace = true, default-features = false, features = ["std", "tls12", "aws_lc_rs"], optional = true }
rustls-native-certs = { workspace = true, optional = true }
rustls-pemfile = { workspace = true, optional = true }
rustls-platform-verifier = { workspace = true, optional = true }

Check warning on line 119 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `rustls-platform-verifier`
x509-cert = { workspace = true, features = ["pem", "builder"], optional = true }

Check warning on line 120 in crates/stdlib/Cargo.toml

View workflow job for this annotation

GitHub Actions / cargo shear

shear/unused_optional_dependency

unused optional dependency `x509-cert`
x509-parser = { workspace = true, optional = true }
der = { workspace = true, optional = true }
pem-rfc7468 = { workspace = true, features = ["alloc"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/stdlib/src/contextvars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mod _contextvars {
use indexmap::IndexMap;

// TODO: Real hamt implementation
type Hamt = IndexMap<PyRef<ContextVar>, PyObjectRef, ahash::RandomState>;
type Hamt = IndexMap<PyRef<ContextVar>, PyObjectRef, rapidhash::quality::RandomState>;

#[pyclass(no_attr, name = "Hamt", module = "contextvars")]
#[derive(Debug, PyPayload)]
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ rustpython-literal = { workspace = true }
rustpython-sre_engine = { workspace = true }

ascii = { workspace = true }
ahash = { workspace = true }
bitflags = { workspace = true }
bstr = { workspace = true }
crossbeam-utils = { workspace = true }
Expand All @@ -64,6 +63,7 @@ num-traits = { workspace = true }
num_enum = { workspace = true }
parking_lot = { workspace = true }
paste = { workspace = true }
rapidhash = { workspace = true }
scopeguard = { workspace = true }
serde = { workspace = true, optional = true }
static_assertions = { workspace = true }
Expand Down
3 changes: 2 additions & 1 deletion crates/vm/src/builtins/type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@ cfg_select! {
/// For attributes we do not use a dict, but an IndexMap, which is an Hash Table
/// that maintains order and is compatible with the standard HashMap This is probably
/// faster and only supports strings as keys.
pub(crate) type PyAttributes = IndexMap<&'static PyStrInterned, PyObjectRef, ahash::RandomState>;
pub(crate) type PyAttributes =
IndexMap<&'static PyStrInterned, PyObjectRef, rapidhash::quality::RandomState>;

unsafe impl Traverse for PyAttributes {
fn traverse(&self, tracer_fn: &mut TraverseFn<'_>) {
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use core::{borrow::Borrow, ops::Deref};

#[derive(Debug)]
pub(crate) struct StringPool {
inner: PyRwLock<std::collections::HashSet<CachedPyStrRef, ahash::RandomState>>,
inner: PyRwLock<std::collections::HashSet<CachedPyStrRef, rapidhash::quality::RandomState>>,
}

impl Default for StringPool {
Expand Down
7 changes: 5 additions & 2 deletions crates/vm/src/vm/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ where
} as usize);

// Initialize frozen modules (core + user-provided)
let mut frozen: std::collections::HashMap<&'static str, FrozenModule, ahash::RandomState> =
core_frozen_inits().collect();
let mut frozen: std::collections::HashMap<
&'static str,
FrozenModule,
rapidhash::quality::RandomState,
> = core_frozen_inits().collect();
frozen.extend(frozen_modules);

// Create PyGlobalState
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/vm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ pub(crate) struct CallableCache {
pub struct PyGlobalState {
pub config: PyConfig,
pub module_defs: BTreeMap<&'static str, &'static builtins::PyModuleDef>,
pub frozen: HashMap<&'static str, FrozenModule, ahash::RandomState>,
pub frozen: HashMap<&'static str, FrozenModule, rapidhash::quality::RandomState>,
pub stacksize: AtomicCell<usize>,
pub thread_count: AtomicCell<usize>,
pub hash_secret: HashSecret,
Expand Down
Loading