Coder Social home page Coder Social logo

BTreeMap instead of HashMap about netcdf HOT 5 CLOSED

georust avatar georust commented on June 19, 2024
BTreeMap instead of HashMap

from netcdf.

Comments (5)

evomassiny avatar evomassiny commented on June 19, 2024

Good idea ! I don't think performance matters much in this part of the code, so i don't see why not :)
@mhiley do you agree ?

from netcdf.

mhiley avatar mhiley commented on June 19, 2024

I agree @evomassiny. @pick2510 Feel free to submit a PR!

from netcdf.

pick2510 avatar pick2510 commented on June 19, 2024

Thx for the feedback.
Unfortunately I found out that BTreeMap doesn't preserve the order of insertion. Instead the data gets ordered alphabetically by the keys. Even though this is nicer than unordered, it doesn't solve my problem how I thought.
A vector would satisfy the order preserving criteria. But that would involve a lot of changes in your code.
I'm not sure if the advantage is worth it...

from netcdf.

bluss avatar bluss commented on June 19, 2024

You could drop in indexmap or another deterministically ordered hashmap. Indexmap doesn't do full insertion order, but it is a deterministic iteration order. (It swaps items around if you remove them from the map).

from netcdf.

magnusuMET avatar magnusuMET commented on June 19, 2024

8f44ba8 makes iteration over variables, attributes, and dimensions deterministic.

from netcdf.

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.