View previous topic :: View next topic |
Author |
Message |
Ligustah
Joined: 21 Oct 2007 Posts: 45 Location: Berlin, Germany
|
Posted: Tue Dec 11, 2007 2:28 pm Post subject: Caching |
|
|
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
Mfg Ligustah |
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Tue Dec 11, 2007 6:44 pm Post subject: |
|
|
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 |
|
|
Ligustah
Joined: 21 Oct 2007 Posts: 45 Location: Berlin, Germany
|
Posted: Wed Dec 12, 2007 11:37 am Post subject: |
|
|
Ya, for example. If i am not mistaken PHP caches its bytecode, too.
Mfg Ligustah |
|
Back to top |
|
|
JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Wed Dec 12, 2007 1:03 pm Post subject: |
|
|
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 |
|
Back to top |
|
|
r.lph50
Joined: 27 Nov 2006 Posts: 21 Location: New Zealand
|
Posted: Fri Dec 14, 2007 11:33 pm Post subject: |
|
|
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 |
|
|
|