[Sugar-devel] SVG performance

Michael Stone michael at laptop.org
Sat Dec 13 16:22:39 EST 2008


On Sat, Dec 13, 2008 at 04:04:15PM -0500, Walter Bender wrote:
>It was easy enough to add the extra couple of lines to see if the
>cache already exists. TA launches blazingly fast (after the very first
>time you use it). But I do have two concerns: (1) now that TA caches
>its images, which are language-specific, how do I catch a change in
>language and then generate a new cache? I suppose I could make all the
>filenames include a language-specific suffix of some sort, but that
>seems kludgy. (2) When I update the activity, how will I know to
>update the cached images?

Well, if you put the images inside a directory named '$version-$lang',
then it would be fairly easy to determine when to regenerate them,
right? (You can find out what language you're running under by examining
environment variables like "LANG" [man 3 getenv].)

The other thing to be careful about here is atomicity: what happens if
the user runs out of power mid-way through the first run of TurtleArt?
(Fortunately, direct application of rename() [man 2 rename] can resolve
this issue without too much difficulty...)

Regards,

Michael

NB: 
  * getenv("LANG") from C is spelled os.environ['LANG'] in python.
  * rename("a", "b") in C is spelled os.rename("a", "b") in python.



More information about the Sugar-devel mailing list