Re: [SMARTY-DEV] more abstraction committed

From: Date: Fri, 09 May 2003 14:29:06 +0000
Subject: Re: [SMARTY-DEV] more abstraction committed
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1430@lists.php.net to get a copy of this message
Why? On Thu, 08 May 2003, Monte Ohrt wrote: > I committed some more (fairly major) changes. > > So far, the following private functions have been removed from > Smarty.class.php and into their own plugin core files: > > core.assign_smarty_interface.php > core.compile_template.php > core.create_dir_structure.php > core.display_debug_console.php > core.fetch_template_info.php > core.get_include_path.php > core.get_microtime.php > core.get_php_resource.php > core.is_secure.php > core.is_trusted.php > core.load_plugins.php > core.load_resource_plugin.php > core.parse_file_path.php > core.process_cached_inserts.php > core.read_cache_file.php > core.rm_auto.php > core.rmdir.php > core.run_insert_handler.php > core.smarty_include.php > core.smarty_include_php.php > core.write_cache_file.php > core.write_compiled_template.php > > This has reduced the size of Smarty.class.php from 88K down to 52K. > There is still quite a bit more that can be abstracted, but this is a > good start. > > I tried a simple benchmark to see how it responds. This is a simple > "hello world" template with one config_load call: > > commmand_line: > 2.5.0: 1.08s > cvs: 0.73s > > apache with PHPA: > 2.5.0: 0.122s > cvs: 0.120s > > apache-gzip with PHPA: > 2.5.0: 0.036s > cvs: 0.035s > > As you can see, the gains from command line execution are quite nice, > but with PHPA the gains are almost negligible, but at least they are not > any slower so this abstration is not causing any performance drop! > > I mostly abstracted things used during the compile phase. The other > things (like filepath rendering) I left to keep optimum speed. (I think > the filepath rendering should be cached instead of computed on each page > call. That's another project :-) > > My goal is to abstract everything that can be done so without a > performance penalty. I think all of the compiler functions could be > broke down to this too, maybe getting rid of Smarty_Compiler.class.php > altogether. > > Anyways, a LOT has changed here so bugs may be present. I tried to test > as good as I could, but please help! > > FYI, I'm off to Las Vegas for one week starting tomorrow, so I won't be > too responsive until the 19th. > > Let me know what you all think of this direction for Smarty. > > Monte > > > > -- > Smarty Development Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -Andrei http://www.gravitonic.com/ For society, it's probably a good thing that engineers value function over appearance. For example, you wouldn't want engineers to build nuclear power plants that only _look_ like they would keep all the radiation inside. (Scott Adams - The Dilbert principle)

« previous php.smarty.dev (#1430) next »