debris / elastic-array Goto Github PK
View Code? Open in Web Editor NEWelastic vector backed by fixed size array
elastic vector backed by fixed size array
Not sure why we have a fork there, but maybe we should close this one and move activity over there?
This PR renaming to_vec
to into_vec
accidentally introduced a silent performance regression between 0.8
and 0.9
. Since ElasticArray
implements Deref<Target=[u8]>
, all the usages of ElasticArray::to_vec
in the code have now silently been replaced with <&[T]>::to_vec
, which is consistently O(n)
(whereas ElasticArray::to_vec
is either O(1)
or O(n)
depending on the size of the array). I discovered this when I migrated to 0.9
and the compilation still succeeded. I don't know there's much we can do about this other than documenting it, but it is something that I'd say needs to be documented.
It should be noted that this doesn't actually affect the Parity codebase, since I just ran it through sed
and then fixed the places where it really did need to be to_vec
. Maybe it would be worth pinging our reverse dependencies.
AFAICT, it is not possible (or rather, easy) to have a std::borrow::Cow
where the Owned
is an ElasticArray
. In order for this to be possible, we need a new type representing a reference to an ElasticArray
contents that implements ToOwned<Owned=ElasticArray...>
. Any thoughts on creating such a type? I'm not sure exactly what to call it. Maybe like ElasticArrayRefN
?
It would be desirable to be able to use elastic-array
in a no_std
context. The main thing blocking this is the heapsize
dependency. Maybe it can be made optional?
Used here.
Using uninitialized, you run into the same soundness issues already explored by crates arrayvec and smallvec.
See bugs servo/rust-smallvec/issues/4 and servo/rust-smallvec/issues/5
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.