Coder Social home page Coder Social logo

Comments (3)

ae-foster avatar ae-foster commented on June 3, 2024 1

Hey @alexeyev . In general, you should make the batch sizes as large as possible. In fact, using insertion_session automatically does some batching, see https://github.com/ekzhu/datasketch/blob/master/datasketch/storage.py#L226 . You could try running without your own batching and see whether the in-built batching is sufficient for your purposes. This literal value of 50000 needs to be changed in future to something user-specifiable.

Secondly, on the question of performance, the additional time you see almost certainly results from additional network I/O which is inevitable when using Redis. Large batch sizes mitigate this as much as possible. It can be instructive to profile your insertion code to confirm this. I once looked into creating Redis dump files without running a live Redis server (see https://github.com/ae-foster/rdbgenerate) but this didn't seem promising.

from datasketch.

alexeyev avatar alexeyev commented on June 3, 2024

Also -- am I doing it wrong or does adding redis backend slow down indexing process dramatically?

from datasketch.

ekzhu avatar ekzhu commented on June 3, 2024

Yes, in my experience redis insertion can be slow due to the serialization and deserialization, even when the database is running on the same machine.

A possible solution to this problem is to implement a way to initialize a Redis-backed LSH from a Dictionary-backed LSH. So you can insert into a Dictionary-backed LSH first (fast), and when you are done, you can (asynchronously) create the Redis-backed LSH.

This way you can start using the Dictionary-backed LSH right-away.

from datasketch.

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.