Re: RFS: ipbt
On Wed, Jul 05, 2006 at 10:19:15PM -0400, Bryan Donlan wrote:
> On 7/5/06, Adam Borowski <email@example.com> wrote:
> >On Wed, Jul 05, 2006 at 02:28:59PM -0400, Bryan Donlan wrote:
> >> * Package name : ipbt
> >> ipbt - Fast, advanced ttyrec player
> >Oops, on just loading a typical NetHack recording:
> >real 1m36.499s
> >user 1m35.050s
> >sys 0m0.648s
> >Something is terribly wrong here, as my very inefficient
> >implementation of the same loads the same file in a split second.
> The current implementation loads all frames of the movie ahead of
> time, generates a list of (character position, frame index, new value)
> structures, then sorts by position and time. This allows it to rapidly
> reconstruct the value of any character at any frame.
My idea was to store the unprocessed vt100 stream and just generate
checkpoints every X bytes. Every checkpoint contains a snapshot of
the tty state, so seeking is a matter of silently sending the vt100
stream since the last checkpoint to your tty emulator -- silently as
in "no immediate screen updates".
On any recording of reasonable size this is actually going so fast
that in my last alpha release (termrec) I create the checkpoints but
not actually use them yet; every seek does a complete reload since
the very start.
PuTTY tty engine is more sophisticated than mine, but I don't see any
reason why it would be significantly slower; this appears to be a
fault of the storage data structure.
Anyway, I doubt if I'll find the time to finish up termrec anytime
soon, but if you would find any pieces of code useful, feel free to
take them, without bothering yourself with license issues (ipbt is
MITed; termrec is GPLed but it's mine -- so here's the license grant).
1KB // Microsoft corollary to Hanlon's razor:
// Never attribute to stupidity what can be
// adequately explained by malice.