Comments (2)
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.
@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)
- Add docs HOT 1
- Allow for structured phrases and passing of lists as well as files HOT 1
- Provide more built in conversion methods for common use cases. HOT 1
- Implement set_separator HOT 1
- Allow RanCat.set_conversion to accept string of rancat.conversion.* funcs HOT 1
- Investigate better licensing HOT 1
- Get rid of ugly imports in example code HOT 1
- hard reset should return self
- Remove old configs for integrations that are no longer needed.
- Make docs more interesting to begin with
- Elaborate in the Contributing documentation
- Link important docs into documentation HOT 1
- find a better issue tracker HOT 1
- Copy contributing.md to end of README HOT 3
- Feature Requests HOT 1
- tech project name generator option HOT 4
- "Lazy loading" performance vs. randomness HOT 3
- Have a default set of inputs from lorem ipsum text. HOT 10
- Allow urls to be used as a source for the generator. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rancat.