Code Monkey home page Code Monkey logo

Comments (3)

benalexau avatar benalexau commented on May 20, 2024

Quoting the docs for the benefit of others finding this ticket:

MDB_MULTIPLE - store multiple contiguous data elements in a single request. This flag may only be specified if the database was opened with MDB_DUPFIXED. The data argument must be an array of two MDB_vals. The mv_size of the first MDB_val must be the size of a single data element. The mv_data of the first MDB_val must point to the beginning of the array of contiguous data elements. The mv_size of the second MDB_val must be the count of the number of data elements to store. On return this field will be set to the count of the number of elements actually written. The mv_data of the second MDB_val is unused.

This is currently unsupported by LmdbJava.

Internally LmdbJava's BufferProxy populates MDB_vals with the required size (length) and pointer to data. We could amend our approach to always reserve space for two MDB_vals, but the different BufferProxy implementations would still require a way to determine the size of each data element and the count of data elements. The main buffers (eg DirectBuffer, ByteBuffer) do not have a field to communicate such details, so we'd need to overload Cursor.put(T, T, PutFlags...) to support these additional arguments and pass them through to BufferProxy via amended in methods (I'd suggest just adding the data count and element size to each in method and the former remains 1 for all existing calls).

Overall it's a reasonable amount of complexity and effort to make this possible. Can I ask about your use case?

from lmdbjava.

harrigan avatar harrigan commented on May 20, 2024

Thank you for the clarification.

I am bulk loading an adjacency list for a large graph (key = vertex, data = neighbours). I have the complete list of neighbours for each vertex in sorted order. I append each neighbour using a call to put with the PutFlags/MDB_APPENDDUP flag.

The graph is dense: I have many more edges than vertices. I wanted to check if I could make one call to put per vertex rather than per edge and what impact that would have on performance.

from lmdbjava.

benalexau avatar benalexau commented on May 20, 2024

I'll close this ticket, as I've created a new one (#28) to track the new feature request.

from lmdbjava.

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.