From: Sam H. <sh...@ma...> - 2006-09-01 19:23:01
|
On Jul 28, 2006, at 12:16 AM, Sam Hathaway wrote: > Does it bother anyone else how slow SetMaker is? It's not that > module's fault, it just takes a long time to render problems, and > rendering 20 of them gets pretty insane. > > I was thinking that a solution to this would be to cache the entire > output of the problem processor. For non-interactive situations > like SetMaker, the only thing we'd need to cache on is the problem > seed -- other data (like num_correct, num_incorrect, etc.) are > always the same. This isn't the whole story. There are a lot of things that can invalidate the cache: - changing the pg source - changing an auxiliary file - changing a macro file - changing a pg module (don't worry about that though) - changing certain values in global.conf or course.conf that are propagated through to the problem environment For equation image caching, we ignore everything but the first one. It is possible to end up with stale images, but it hasn't been a big deal since the math munging code is pretty static and most people aren't making changes that would disrupt that. If the whole translation process is being cached, many more things could change the output, and it would be pretty confusing if SetMaker.pm was showing older output than Problem.pm. > The cache could simply be a file containing the problem TEXT, named > based on the source file name and the problem seed, or we could get > a little more complex and also store the names of any temporary > files that the problem depends on. That way, deleting, say, a > generated graph would invalidate the cache and cause the problem to > be re-rendered. > > This would speed up problem browsing TREMENDOUSLY, since PG > wouldn't even run once ANYONE had browsed a problem set. This might > even be a good candidate for pre-caching -- run through the problem > library once with seed 1234 to save a lot of instructor time down > the road. |