Skip to content

Commit

Permalink
refactor!(core): delete the utils feature of the core crate (#254)
Browse files Browse the repository at this point in the history
* remove the `utils` feature from the core crate

* update code

* fuse grid module files into a single file

* remove unused imports
  • Loading branch information
imrn99 authored Dec 12, 2024
1 parent 7191124 commit 739dc00
Show file tree
Hide file tree
Showing 22 changed files with 599 additions and 1,247 deletions.
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ honeycomb.workspace = true
rayon.workspace = true

[dev-dependencies]
honeycomb-core = { workspace = true, features = ["utils"] }
honeycomb-core.workspace = true
criterion = { workspace = true, features = ["html_reports"] }
iai-callgrind.workspace = true
rand = { workspace = true, features = ["small_rng"] }
Expand Down
8 changes: 1 addition & 7 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false
autoexamples = false

[dev-dependencies]
honeycomb-core = { workspace = true, features = ["utils", "io"] }
honeycomb-core = { workspace = true, features = ["io"] }
honeycomb-render = { workspace = true }
honeycomb-kernels = { workspace = true }
rand = { workspace = true, features = ["small_rng"] }
Expand All @@ -33,12 +33,6 @@ path = "examples/io/read.rs"
name = "io_write"
path = "examples/io/write.rs"

# memory usage

[[example]]
name = "memory_usage"
path = "examples/memory_usage/compute.rs"

# parallelization

[[example]]
Expand Down
27 changes: 0 additions & 27 deletions examples/examples/memory_usage/compute.rs

This file was deleted.

259 changes: 0 additions & 259 deletions examples/examples/memory_usage/plot.py

This file was deleted.

1 change: 0 additions & 1 deletion honeycomb-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ publish = true

[features]
io = ["dep:vtkio"]
utils = []

# deps

Expand Down
21 changes: 0 additions & 21 deletions honeycomb-core/src/attributes/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,3 @@ impl<A: AttributeBind + AttributeUpdate> AttributeStorage<A> for AttrSparseVec<A
self.remove_core(trans, &id)
}
}

#[cfg(feature = "utils")]
impl<T: AttributeBind + AttributeUpdate> AttrSparseVec<T> {
/// Return the amount of space allocated for the storage.
#[must_use = "returned value is not used, consider removing this method call"]
pub fn allocated_size(&self) -> usize {
self.data.capacity() * std::mem::size_of::<Option<T>>()
}

/// Return the total amount of space used by the storage.
#[must_use = "returned value is not used, consider removing this method call"]
pub fn effective_size(&self) -> usize {
self.data.len() * std::mem::size_of::<Option<T>>()
}

/// Return the amount of space used by valid entries of the storage.
#[must_use = "returned value is not used, consider removing this method call"]
pub fn used_size(&self) -> usize {
self.n_attributes() * size_of::<TVar<Option<T>>>()
}
}
Loading

0 comments on commit 739dc00

Please sign in to comment.