-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an option not to have the whole database in memory #4
Comments
You need to have much of it in memory to find the data section seperator. See https://github.com/daurnimator/mmdblua/blob/master/mmdb.lua#L20 After that, I'm not sure if it's worth putting the work in for this? |
no it's not high priority. But would be nice, as right now basically my server thing takes 3MB and the database 30MB. With the other geoip bindings there was an option to map the file in memory, so multiple instances of the same program would allocate the memory only once. I'll look around if there's a decent lua library that can do this with arbitrary files and expose them as strings. |
Yeah; they'll probably be using
That won't be possible; lua strings are interned. |
I know, I mean expose the mmaped region in some way semantically equivalent to a string. |
Looking through again there isn't that many string methods in use:
You should be able to replace most of these with a |
To quote myself from #5 (comment)
|
Suggestions for the right way to do this? I think that file:seek() would work.
The text was updated successfully, but these errors were encountered: