Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(rust): remove wasm-timer dependency #10347

Merged
merged 2 commits into from
Aug 7, 2023
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
3 changes: 0 additions & 3 deletions crates/polars-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ serde_json = "1"
[build-dependencies]
version_check = { workspace = true }

[target.'cfg(target_family = "wasm")'.dependencies]
wasm-timer = "0.2.5"

[features]
simd = ["arrow/simd", "polars-arrow/simd"]
nightly = ["simd", "hashbrown/nightly", "polars-utils/nightly", "polars-arrow/nightly"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{using_string_cache, StringCache, POOL};
pub enum RevMappingBuilder {
/// Hashmap: maps the indexes from the global cache/categorical array to indexes in the local Utf8Array
/// Utf8Array: caches the string values
GlobalFinished(PlHashMap<u32, u32>, Utf8Array<i64>, u128),
GlobalFinished(PlHashMap<u32, u32>, Utf8Array<i64>, u32),
/// Utf8Array: caches the string values
Local(MutableUtf8Array<i64>),
}
Expand Down Expand Up @@ -50,7 +50,7 @@ impl RevMappingBuilder {
pub enum RevMapping {
/// Hashmap: maps the indexes from the global cache/categorical array to indexes in the local Utf8Array
/// Utf8Array: caches the string values
Global(PlHashMap<u32, u32>, Utf8Array<i64>, u128),
Global(PlHashMap<u32, u32>, Utf8Array<i64>, u32),
/// Utf8Array: caches the string values
Local(Utf8Array<i64>),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct State {

#[derive(Default)]
pub(crate) struct RevMapMerger {
id: u128,
id: u32,
original: Arc<RevMapping>,
// only initiate state when
// we encounter a rev-map from a different source,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::hash::{Hash, Hasher};
use std::sync::atomic::{AtomicU32, Ordering};
use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard};
use std::time::{SystemTime, UNIX_EPOCH};

use ahash::RandomState;
use hashbrown::hash_map::RawEntryMut;
Expand All @@ -16,6 +15,7 @@ use crate::prelude::InitHashMaps;
/// to determine how many threads use the string cache
/// if the refcount is zero, we may clear the string cache.
pub(crate) static USE_STRING_CACHE: AtomicU32 = AtomicU32::new(0);
static STRING_CACHE_UUID_CTR: AtomicU32 = AtomicU32::new(0);

/// RAII for the string cache
/// If an operation creates categoricals and uses them in a join
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Hash for Key {

pub(crate) struct SCacheInner {
map: PlIdHashMap<Key, ()>,
pub(crate) uuid: u128,
pub(crate) uuid: u32,
payloads: Vec<StrHashGlobal>,
}

Expand Down Expand Up @@ -180,16 +180,7 @@ impl Default for SCacheInner {
fn default() -> Self {
Self {
map: PlIdHashMap::with_capacity(HASHMAP_INIT_SIZE),
#[cfg(not(target_family = "wasm"))]
uuid: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_nanos(),
#[cfg(target_family = "wasm")]
uuid: wasm_timer::SystemTime::now()
.duration_since(wasm_timer::UNIX_EPOCH)
.unwrap()
.as_nanos(),
uuid: STRING_CACHE_UUID_CTR.fetch_add(1, Ordering::AcqRel),
payloads: Vec::with_capacity(HASHMAP_INIT_SIZE),
}
}
Expand Down
89 changes: 4 additions & 85 deletions py-polars/Cargo.lock

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