FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Caching

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
Ligustah



Joined: 21 Oct 2007
Posts: 45
Location: Berlin, Germany

PostPosted: Tue Dec 11, 2007 2:28 pm    Post subject: Caching Reply with quote

Hi,
If I am right, MiniD compiles every script before running it, doesnt it?
So I was thinking about caching methods, which imho would be quite effective concerning longterm usage of MiniD. For example you could add something like a CacheHandler interface, which would allow the use to define his own cache mechanism. I think that would be quite cool Smile

Mfg Ligustah
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Dec 11, 2007 6:44 pm    Post subject: Reply with quote

For, i.e. a server or something? Where you'd be able to map (in the cache) from code to a compiled version of it?
Back to top
View user's profile Send private message
Ligustah



Joined: 21 Oct 2007
Posts: 45
Location: Berlin, Germany

PostPosted: Wed Dec 12, 2007 11:37 am    Post subject: Reply with quote

Ya, for example. If i am not mistaken PHP caches its bytecode, too.

Mfg Ligustah
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Wed Dec 12, 2007 1:03 pm    Post subject: Reply with quote

Yeah, that's what bobef was planning on (is currently?) doing. He wrote a modification to the MiniD lexer to allow him to embed it in HTML, PHP-style. Then he could compile a page into a closure, and to generate the page upon request he'd just run the closure that had already been compiled. It's a pretty sexy idea Smile
Back to top
View user's profile Send private message
r.lph50



Joined: 27 Nov 2006
Posts: 21
Location: New Zealand

PostPosted: Fri Dec 14, 2007 11:33 pm    Post subject: Reply with quote

Ligustah wrote:
Ya, for example. If i am not mistaken PHP caches its bytecode, too.

PHP doesn't by default, but there are readily available extensions that do. I think MiniD is more like python in this case, and even just writing out .mdm files for every script and then mmap them in when needed could make a small improvement (saves a compilation step). Advantages PHP bytecode caches have is that they are designed for concurrent access, they can often cache other stuff as well and some can cache in shared memory as well as on disk.

Of course you could do what it sounds like bobef is doing: have a long running process where scripts only need to be compiled/loaded once. Although, it'd be nice to share the compiled results between processes so you don't get something like the huge memory hogging ruby on rails processes we have at work.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group