On Tue, Nov 4, 2008 at 2:15 AM, Ville M. Vainio <[EMAIL PROTECTED]> wrote:

> This will work, is easy to implement and will be fast. In fact it's so
> obvious that I feel a slight shame for not thiniking of it before:
>
> There is a dir ~/.leo/filecache
>
> It has file named after md5 sums of the contents of files.
>
> Every file contains a pickled version of data structure that allows
> quickly building the nodes contained in the tree for that file (not
> the actual nodes!.
>
> E.g.
>
> [(node1-gnx, node1-head, node1-body,
>     [(node1.1-gnx, node1.1-head, node1.1-body, []),
>     [(node1.2-gnx, node1.2-head, node1.2-body, []),
>  (node2-gnx, node2-head, node2-body,[]),
> ...]

And to refine this further, instead of actual strings for head and
body, we can have the start and end byte offset within the file of
headlines and bodies.

This will

- Be even faster, since we have already read in the actual file to
calculate the md5sum
- More importantly, make it possible to never delete the cache
(because so little space is used)

The more I think about it, the more I like it. :-)

-- 
Ville M. Vainio
http://tinyurl.com/vainio

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to