Giter VIP home page Giter VIP logo

Comments (4)

gony-noreply avatar gony-noreply commented on May 18, 2024

Hi @huhk-sysu
Information about mmap can be found at the link below.

As you can see on the wiki, mmap is implemented with demand paging. When index.load() is called with use_mmap=True, index read doesn't actually occur. When accessing the index, reading occurs in a lazy manner. This is why your index.load() takes no time and search takes a long time. But the 1.5 minute seems weird.

Load with mmap is suitable in multi-process environments because it allows share memory. If you only use ad single process, it is recommended to use it with use_mmap=False.

from n2.

huhk-sysu avatar huhk-sysu commented on May 18, 2024

Thanks for your detailed explanation. The 1.5 minute may due to the machine, though it's not so clear. Since I'm using single process, I will trying loading with use_mmap=False.

There's another question: In fact I have a large database (~15 million * 768), but my machine's memory is limited and I can't build an index for it. For the moment I split it and build 15 indexes, each one contains 1 million data. Then I load the indexes, when the query comes, I query each of them, and finally aggregate the results. I wonder if it is the suitable way, any suggestions?

from n2.

gony-noreply avatar gony-noreply commented on May 18, 2024

Well, if there is not enough memory, you can use it the way you said. There is no way for N2 to process data larger than the machine's memory yet, but improvements are being made to handle data larger than memory through Product Quantization. The improvement is expected to be available early next year.

from n2.

huhk-sysu avatar huhk-sysu commented on May 18, 2024

Thanks for your advises.

from n2.

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.