|
From: | Miguel de Benito Delgado |
Subject: | Re: [Texmacs-dev] eps image is pixelated |
Date: | Mon, 19 Aug 2013 11:00:53 +0200 |
On 16 August 2013 14:58, Miguel de Benito Delgado <address@hidden> wrote:
In my machine the file loads fast (<1sec) and I notice no difference between first load and subsequent loads after closing the buffer. But scrolling sucks because each time the canvas is shifted, Ghostscript is called. Activating the in-memory caching system results in perfectly smooth scrolling as if no images were there.
Sorry, when I said above "load", I meant scrolling time. So, start TeXmacs, load the file, scroll to the bottom, you'll see significant delays. Scroll again, there are no delays. Close the file (but not TeXmacs), load it again, again scroll with no delays. Close TeXmacs, open it again, load the file, again scroll with delays.
Maybe we could simply activate the cache already implemented in src/Graphics/Picture/picture.cpp for all images as I suggested, then persistently store it? Note that there already is some infrastructure to this end, in src/System/Misc/persistent.cpp.
For images embedded into files we could do the following: upon load they are currently assigned some unique name like ~/.TeXmacs/system/tmp/tmp_1234567890.eps, then converted using gs. Persistently storing the cache would achieve nothing in this situation because it is indexed by URL, it'd just fill up the drive. CRC seems the way to go here yes, but then the relevant parts of the code relying on these tmp_stuff.bla names could be changed to use the CRC as filename, and we may use the current cache and persistently store it.
So: persistent storage of the cache in src/Graphics/Picture/picture.cpp and by-CRC naming of the temporary files related to embedded images.
Thoughts?I think that is the correct approach in terms of where to put it in TeXmacs. I have a bit of a hard time understanding how persistent_write() works. If I understand correctly, it isn't currently used, so we can't do much damage.
(I'm also not totally sure how safe that part is with respect to multiple instances of TeXmacs running).
Do you really have to change the tmp_stuff part? That seems like a big change. Couldn't youjust add caching by CRC (and requested width/height) instead of by filename?
[Prev in Thread] | Current Thread | [Next in Thread] |