Open mafintosh opened 8 years ago
@sorribas sent me this link as well, http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice.html
main problem with smalltable right now is growing the table means rewriting all old values. simple fix would be a "level" approach where we allocate a new file and write new entries to that whilst reading old values using a union approach across all levels. in the background old levels would be merged in when the table is idle
if we merge old values in old levels from the end of the file to the beginning (backwards seek) we could truncate the file as we go a long as well making it detect statically that a value isn't in an old level (offset > length)
first proof of concept, https://github.com/mafintosh/smalltable