Giter VIP home page Giter VIP logo

Comments (2)

mattjegan avatar mattjegan commented on June 2, 2024

Hey, thanks for posting. The design motivation behind that was that we don't want to iterate over the whole file when we load it as it slows everything down if we have large files. You're right in that we could calculate it straight away and in fact, we used to.

The current flow is something like this:

  • "load" the file (simply set it to open in the Handler, and keep track of which line we're up to)
  • If the total amount of seen keys falls between 50% and 100% of the total combinations (that we know of, because we don't know the length of the list as we haven't read all the lines yet) then we read in another read_size lines (defaults to 1000)
  • As those new lines get read in, we update the total combinations

The choice to have a default of 1000 new reads seems good to me as 2 files with over 1000 lines each manage to go 500000 calls to .next() before requiring more file access.

Perhaps I need to document this feature a little more?

from rancat.

ksreenivasan avatar ksreenivasan commented on June 2, 2024

@mattjegan That makes sense.
Yeah.. A little more documentation will go a long way. I was able to make sense of most things looking at the code, but it will be faster to understand if there is documentation also.

from rancat.

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.