Alex,
I've looked into this a little bit more, and it looks like the
`not-working` function (which is, as you say, doing essentially the same
thing as `plot-frame`) is actually kind of working, but is actually
stuttering very badly.
An important detail here is that `plot` is written in Typed Racket,
whereas your code uses regular, untyped Racket. Interfacing Typed Racket
and Racket code may involve a lot of dynamic checks, which can have
significant overhead, and cause that kind of stuttering.
*Where* that boundary lies, though, matters a lot.
If you use `plot-frame`, its (typed) implementation uses the (typed)
version of `make-snip-frame` from inside the `plot` library. The
boundary then lies between your driver code and `plot-frame`. That's not
a very heavily trafficked boundary, so the overhead is minimal.
If you use your hand-rolled equivalent of `plot-frame`, you're using
your own, untyped version of `make-snip-frame`, so the boundary lies
between the typed `plot-snip` and your untyped `make-snip-frame`. That
seems to be a more trafficked boundary, hence the stuttering.
(To complicate matters, Neil uses some tricks to add types to
`make-snip-frame` after the fact, without boundary overhead, which is
why the version you copied looked (and kind of was) untyped.)
Just to confirm, I've converted your file to Typed Racket, and used the
typed version of `make-snip-frame`, and the problem goes away.
So the bottom line is, using `pict-snip` from untyped code may be too
slow to be usable. You may want to write the portion of your program
that uses it in Typed Racket.
Vincent