From: <kn...@wi...> - 2007-01-06 19:44:27
|
Yo, What we mean is basically that you have a GeSHiCache class, which can be used in many different ways. We might even do like the renderer, so that the class is extensible, and many caching solutions can be made. I don't know if the overhead is worth it, though... The idea is to be able to cache different parts in different things. You might for example consider that you will only use one theme. Cache the theme. You will only highlight C code. Cache the C instance. Another idea we had would be to cache in a local file, e.g. serialize the object, and store it in a cache.dat file. Since files usually open fast, it could be worth it. I am not sure, you gotta give your opinion, Nigel. Regards, Knut ----- Original Message ----- From: "Benny Baumann" <Ben...@gm...> To: <ges...@li...> Sent: Saturday, January 06, 2007 2:12 PM Subject: Re: [GeSHi-devel] About Caching > Hi, >> /nigel weighs in now he checks his mail... >> >> Okay, so you guys seem to be on a roll with something. I'm just not sure >> what it is though! :D >> > Well, what we were talking about isquite simular to your idea. >> Basically, I was thinking about caching like: >> >> * User creates GeSHi object >> * User calls various methods >> * User calls useCache('filesystem') // name of backend passed here, >> default to something reasonable >> * User calls parseCode >> > if not cached then >> > store an entry in the cache. The key will be something that >> uniquely >> identifies all the various methods that could have been stored (like >> serialisation perhaps, but perhaps more lightweight). The value will >> be the output of the code parsing. >> > end if >> > return value from cache >> >> -end- >> > Basically there's just one big difference: The user needs to setup the > cache beforehand to use the cache. > > * User creates GeSHi object > * User calls useCache('filesystem') // setup the cache, or by ClassRef > * User calls various methods (they internally use that cache > automatically) > * User calls parseCode (Internally uses the cache if supported) > >> You guys are talking about caching class instances and other such random >> things that I'm not following :). >> > Well, that's simple ;-) We were talking of instances in the way they are > seen at OOP, i.e. that crap you get returned by writing something like > new Classname within your source ;-) > What we ment was, that each caching class can tell, what stuff it want's > to cache and what it will not (because not supported). Also the user is > provided a way to say "even the serializer supports caching source > output I prefer it to be done by the database cache". >> So, what is it that you guys are meaning? How does it work? What benefits >> are gained? >> > Well, the benefits of the proposed method are: > * Little overhead when setting up the cache (call the Caching class and > give it to GeShi) > * Configurable Caches (you can give each cache object separate > parameters for configuration, e.g. for accessing a FTP or database > resource) > * Complete caching (depending on the completeness of the Cache interface > you could store nearly the complete state of GeSHi in a cache) > * Fast Caching (You have short call paths and high cache integration - > no long or slow calls have to been made to enable or disable it. If it's > disabled a single !is_function will do ...) >>>> P.S.: Could you please all send to the list only? Mails are coming in >>>> twice (and more often ;-)) >>>> >> Heh. Stupid squirrelmail, my apologies for the mess I've been making of >> the list :). I will reply to the list only from now on. Squirrelmail by >> default puts the reply to the person and cc's the list... >> >> Nigel >> > I know ... Thunderbird doesn't much different ... > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > geshi-devel mailing list > ges...@li... > https://lists.sourceforge.net/lists/listinfo/geshi-devel > |