Code Monkey home page Code Monkey logo

elastic-array's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

elastic-array's Issues

Make `heapsize` an optional dependency

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?

Accidental performance regression

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.

Ability to make a Cow where the owned is an ElasticArray

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.