insaneinside / symtern Goto Github PK
View Code? Open in Web Editor NEWFast general-purpose interners for every use case
License: Apache License 2.0
Fast general-purpose interners for every use case
License: Apache License 2.0
I've been playing around with it because it seems like it does exactly what I need, but I'm cautious about doing that when it also seems like it's gone inactive, with a couple of caveats still scattered around the documentation and bug tracker.
The symbol pool implemented in basic.rs
uses a value's hash as the key to pool's HashMap
instance, which effectively bypasses any collision handling that would normally be provided by the map. This design was meant to avoid the overhead and additional complexity of using something like Rc
where shared ownership isn't actually required โ but clearly needs some rethinking.
Travis builds are failing because travis-cargo
no longer works.
It's time to take the time to gain a more thorough understanding of how Travis works, and then update .travis.yml
.
The generalized structure of Pool uses the ToOwned
trait to store it's T
's internally.
For str
this leads to the usage of String
as internal data type for the underlying Vec<_>
.
This is inferior to Box<str>
which requires less memory than String
since it is missing the capacity
field which makes it approximately 33% smaller than String
.
So in theory using Box<str>
instead of String
should result in faster access times due to less cache-trashing.
This can be addressed by specializing Pool
for str
to store Box<str>
instead of String
.
The drawbacks are that specialization is currently a nightly feature, however it should be possible to implement this specialization as op-in for depencendies that are okay with nightly versions of the compiler.
Also there should be trait impls for the different kinds of String
types within rust.
So interning a &str
should copy the contents while String
or Box<str>
should move them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.