-
Notifications
You must be signed in to change notification settings - Fork 28
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
IPRTable memory use #41
Comments
I would be better to implement Poptrie to improve footprint: |
@kazu-yamamoto are there any comparisons against the current implementation? From what I understand, Poptrie improves access time but doesn't reduce memory footprint. |
Let's try. Would you send a PR of And tell me your GHC version. |
Do you want just Word8 or do you want mask dropped as well? |
Would you make two commits: one for |
Sure. I'll get to that later today. |
At the moment, IPRTable is quite a hungry beast. For example, a table of almost 700k entries without any data occupies at least several hundreds megabytes. This small test [1] peaks at 318 megabytes [2]. The networks list I used is here [3]. For comparison, the same code using Data.Map.Strict requires half that amount [4].
Is there a way to improve this? Another question is whether this is just an IPRTable problem, or are there any other improvements to make?
For example, the 'mask' field could be dropped from AddrRange since it is redundant. Without it and with mlen's type switched to Word8, memory use dropped to 295 megabytes, which is a bit better but clearly not enough.
1: https://gist.github.com/greydot/b61836d8a7991da1bad37ed4ac4b0584
2: > /usr/bin/time -v ./t networks 2>&1 | grep "Maximum res"
Maximum resident set size (kbytes): 318756
3: https://gist.githubusercontent.com/greydot/8ad4b7c947d00060cd385402f36bf881/raw/ac645499a4a139ba0926a791cc0a8da52352bf3b/networks
4: > /usr/bin/time -v ./t networks 2>&1 | grep "Maximum res"
Maximum resident set size (kbytes): 179364
The text was updated successfully, but these errors were encountered: