You can store arbitrary things in the buffer using the
bufferDynamicValueA accessor.
There are examples of usage in Vim keymap and Dired.
You can store strings at the editor level using dynA, in a similar way.

I find a 10 second delay very huge though; you might benefit from
using Data.Binary.

Hope this helps,
JP.

On Mon, Feb 23, 2009 at 10:09 PM, Gwern Branwen <[email protected]> wrote:
>
> So recently I've found the 10 second delays for IReader mode to be
> increasingly irritating. I don't insist on instant switches, but
> certainly I'd prefer something like a few seconds.
>
> So I went and looked at it again; the packs and unpacks struck me as
> possible causes, so I switched back to String as the basetype. Then I
> noticed that prepending and appending were how I was implementing a
> circular list. So I replaced the list operations with instead
> Data.Sequence, which allows O(1) appends and prepends; sequence works
> since this is obviously always going to be a strict list. Seq String
> works well enough. But it was still way too slow. So I backgrounded
> the writing of the database with forkIO. Still no good. (I've sent in
> patches for the foregoing.)
>
> The chief delay now seems to be that of doing the file IO on
> articles.db and then running read on it. This has to be done on every
> buffer switch since each time the buffer-switching function has no
> access to the previously-read-and-parsed database, which is obviously
> very slow. Is there any way to define a buffer-local variable of some
> sort I could stick the parsed (Seq String) into? I looked around but I
> didn't see anything that looked like it might help much.
>
> --
> gwern
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---

Reply via email to