Giter VIP home page Giter VIP logo

Comments (6)

Gankra avatar Gankra commented on August 22, 2024

As in you want upstream to expose RawTable?

from linked-hash-map.

apasel422 avatar apasel422 commented on August 22, 2024

More like having std itself provide LinkedHashMap instead of hacking on top of it as this crate currently does.

from linked-hash-map.

apasel422 avatar apasel422 commented on August 22, 2024

What I want to do here is define RawTable as:

struct RawTable<K, V, A = ()> {
    capacity: usize,
    size: usize,
    hashes: Unique<u64>, // dynamic allocation of `cap` `u64`s | `cap` `K`s | `cap` `V`s | `cap` `A`s
    aug: A, // used to store the head/tail indices for the linked version
    marker: marker::PhantomData<(K, V)>,
}

and then

struct Link {
    next: usize,
    prev: usize,
}

pub struct LinkedHashMap<K, V> {
    table: RawTable<K, V, Link>,
    ...
}

This will let us remove the extra key/value indirection in the current impl along with the dummy node, though the performance implications remain to be determined.

from linked-hash-map.

Gankra avatar Gankra commented on August 22, 2024

Forking std's impl seems more viable, honestly.

from linked-hash-map.

apasel422 avatar apasel422 commented on August 22, 2024

I think we should look into this, even if it involves maintaining an internal copy of RawTable for the time being.

CC @carllerche.

from linked-hash-map.

carllerche avatar carllerche commented on August 22, 2024

To follow up, I extracted the hash table as a standalone library that runs on stable Rust. https://github.com/carllerche/hash-table

from linked-hash-map.

Related Issues (20)

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.