Skip to content

Commit

Permalink
some plans
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosnec committed May 2, 2014
1 parent 2831256 commit 2a82c6f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/planning.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,20 @@ Planning
- Possible pitfalls when I want to make major changes to
word-scraper, because I'll have to change two projects. So it is
probably best to work mainly on b-plus-tree

# May 2, 2014

## Delayed Persistence
- Instead of writing each node to disc each time one is altered, have
a hash-map, mapping RAF offsets to nodes which have already been
read and/or altered
- Whenever a node needs to be read off the disc, first check if its
offset is already in the hash-map, and use the in-memory node
instead if one exists
- Instead of simply using `assoc` to add new nodes to the map, write a
function which checks the number of elements in the map, and if it
reaches a certain threshold (a parameter to the function), write
half of the nodes at random to disc, and `dissoc` them from the map
after they've been written
- When all operations are finished, write the entire hash-map to disc,
and let it be garbage-collected

0 comments on commit 2a82c6f

Please sign in to comment.