Comments (7)
Ok. c828cc6
Will be included in the next release.
from ahash.
I prefer once_cell. I actually started with it. However it pulls in a huge number of transitive dependencies (or at least it did when I last checked), and I would like to keep aHash as light as possible given how low level it is.
from ahash.
Just checked, once_cell
has a single optional dependency (parking_lot
). Same for version 1.0.1 (1.0.0 is yanked). Maybe a pre-1.0 version had more deps, but it's certainly not the case now
from ahash.
I think the trouble is that aHash would need parking_lot. Per the doc:
To implement a sync flavor of OnceCell, this crates uses either a custom re-implementation of std::sync::Once or parking_lot::Mutex. This is controlled by the parking_lot feature, which is enabled by default. Performance is the same for both cases, but the parking_lot based OnceCell is smaller by up to 16 bytes.
Which is sort of a shame, because the whole reason for the need for the lock is to block to make sure the initialization code doesn't get run multiple times. However I don't actually care about that. If there were an "ApproximatelyOnceCell" with zero deps that would be ideal.
from ahash.
I don't exactly understand. Is it that you wouldn't want to use once_cell
with a 16 byte overhead?
from ahash.
I don't care about the 16 bytes. I care about pulling in a dependency on parking_lot. If I can avoid having all those deps and get a working solution I'd be happy. I created matklad/once_cell#133 to track the issue. Either of matklad/once_cell#61 or matklad/once_cell#53 would also be acceptable.
from ahash.
Oh, so the issue is no_std
support. That wasn't clear before. Thanks for following up with once_cell
, I'm curious to see where that goes; it would be relevant for tracing too (tokio-rs/tracing#1165).
from ahash.
Related Issues (20)
- Compiling without min_specialization and stdsimd HOT 1
- into_keys and into_values do not work with AHashMap HOT 2
- please tag releases HOT 2
- Some extra work is required to get ahash to work with rayon HOT 2
- Consider Re-Exposing `AHasher::new_with_keys` HOT 2
- Using with neither `compile-time-rng` or `runtime-rng` features. HOT 2
- Simple, Non-DOS-resistent seed HOT 14
- 0.8.0 requires "resolver" due to Cargo bug HOT 6
- Make once_cell optional to meet reasonable MSRV HOT 8
- Question: Callhasher is removed from public interface HOT 1
- Reproducible Hashes is 0.8? HOT 4
- `random_state::RandomState: Default` not implemented when using neither `compile-time-rng` nor `runtime-rng` features HOT 2
- Fails to compile on no-std
- ahash features are non-additive HOT 5
- Cannot compile to wasm without wasm-bindgen with v0.8.1 HOT 5
- 0.8.1 fails to compile for no-std HOT 2
- ahash: 0.8.1: Failed to parse expression HOT 1
- SMHasher Sparse Test Failure HOT 2
- adding ability to build HashMap from rayon parallel iterator HOT 1
- Please disable feature `runtime-rng` by default HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahash.