Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Improvement for better caching (i.e. using Zend Optimizer)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
patrick
Guest





PostPosted: Tue Apr 22, 2003 10:16 pm    Post subject: Improvement for better caching (i.e. using Zend Optimizer) Reply with quote

hi,

currently smarty uses
Code:
include($compiled_filename)

to load a previously compiled filename.

This way, caching using Zend Optimizer or similar products does not work very well.

My proposal:
Why doesn't smarty compile files which can be loaded using
Code:
require_once($compiled_file);

The compiled files just would have to define a function, i.e.
Code:
function template_3324878334() { // 3324878334 is a unique id for the template
[... compiled template code ...]
}

and could be called using eval(). This would significantly improve smarty's performance, especially if you use the same template more than once on the same page.

Regards,
patrick AT krankikom.de
Back to top
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Apr 23, 2003 1:26 am    Post subject: Reply with quote

Fascinating and instructive.

Questions:

1) how does this affect scoping (ie. changing to a functionalized format)
2) how much is the cost of turning everything into functions (as opposed to direct executable code) which much then be called?
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Apr 23, 2003 7:42 am    Post subject: Reply with quote

i think ZendOptimizer is just a toy regarding optimization. it is more designed to run encoded php-code than to speed things up.

i prefer php-accelerator ( http://www.php-accelerator.co.uk/ ) it speeds up the inlucde() of the templates (and even the include of Smarty.class.php Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Apr 23, 2003 12:23 pm    Post subject: Reply with quote

For a working PHP accelerator for windows, you might want to try Turck MMCache which I've had success with running on a Win2K box.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
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
Protected by Anti-Spam ACP