|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
patrick Guest
|
Posted: Tue Apr 22, 2003 10:16 pm Post subject: Improvement for better caching (i.e. using Zend Optimizer) |
|
|
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
|
Posted: Wed Apr 23, 2003 1:26 am Post subject: |
|
|
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 |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Apr 23, 2003 7:42 am Post subject: |
|
|
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 |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Apr 23, 2003 12:23 pm Post subject: |
|
|
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 |
|
|
|
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
|