SitePoint Sponsor

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 25 of 59

Hybrid View

  1. #1
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Php "compiler" class

    Hi. I just made a php "compiler" class and I fell to share it. By compiler, I mean a class which will merge all files into one, removing comments, unwanted spaces and unwanted carriage-return. It it very usefull if you always include/require a lot of files to increase speed.

    here's the class :
    PHP Code:
    <?php
    // +---------------------------------------------------------------------------+
    // | Framework for Php4                                                        |
    // |---------------------------------------------------------------------------+
    // | Author : Jean-Philippe Déry <jeanphilippe_dery@hotmail.com>               |
    // +---------------------------------------------------------------------------+
    // | This program is free software; you can redistribute it and/or modify      |
    // | it under the terms of the GNU General Public License as published by      |
    // | the Free Software Foundation; either version 2 of the License, or         |
    // | (at your option) any later version.                                       |
    // +---------------------------------------------------------------------------+

    define('ROOT''../');
    define('LINEBREAK'"\n");
    define('BRACKET_ON_SAME_LINE'1);

    /**
     * "Compiler" Class. This class reads all files from a directory and merge them
     * into a big one. Very usefull to get some speed if, in each pages, you
     * include a lot of differents files.
     *
     * @author  Jean-Philippe Déry <jeanphilippe_dery@hotmail.com>
     * @version 1.0
     */
    class Compiler
    {
        
    /**
         * Compile each files from this directory.
         *
         * @type   string
         * @access private
         * @since  1.0
         */
        
    var $dir  'lib/';
        
        
    /**
         * Compiled file.
         *
         * @type   string
         * @access private
         * @since  1.0
         */
        
    var $file 'include/all.php';

        
    /**
         * Constructeur. Compile
         *
         * @access public
         * @since  1.0
         */
        
    function Compiler()
        {
            
    $this->compile();    
        }
        
        
    /**
         * Compile all files into a single one
         *
         * @access private
         * @since  1.0
         */
        
    function compile()
        {
            
    $this->file ROOT $this->file;
            
    $this->dir  ROOT $this->dir;
            
            
    $files '';
            
            
    // Reads all files
            
    if (!$dp opendir($this->dir))
            {
                
    trigger_error('Cannot open directory ' $this->dir);        
            }
            
            while (
    $file readdir($dp))
            {
                if ((
    $file != '..') && ($file != '.') && (!is_dir($this->dir $file)))
                {
                    echo 
    '<code>Compile file ' $file ' ';
                    
                    
    $filelines file($this->dir $file);
                    
                    
    // Remove end of line comments 
                    
    foreach ($filelines as $i => $line)
                    {
                        
    $filelines[$i] = trim($filelines[$i]);
                        
    $filelines[$i] = preg_replace('/\/\/.*$/m'''$line);
                        
                        if (
    $i 10 == 0)
                        {
                            echo 
    '.';
                        }
                    }
                                                
                    
    $files .= implode(''$filelines);

                    echo 
    ' <b>done</b><br>';
                }
            }

            @
    closedir($dp);
            
            
    // Remove php tags
            
    $files str_replace('<?php'''$files);
            
    $files str_replace('?>'''$files);
            
            
    // Remove block comments
            
    $files preg_replace('/\/\*(.*?)\*\//s'''$files);
            
            
    // Remove unwanted \n        
            
    $files preg_replace("/(\r\n)+/s""\n"$files);
            
    $files preg_replace("/((\r\n)+(\t)+(\r\n)+)/s""\n"$files);
            
    $files preg_replace("/((\r\n)+(\s)+(\r\n)+)/s""\n"$files);

            
    $files preg_replace("/(\n)+/s""\n"$files);
            
    $files preg_replace("/((\n)+(\t)+(\n)+)/s""\n"$files);
            
    $files preg_replace("/((\n)+(\s)+(\n)+)/s""\n"$files);
            
            if (
    defined('BRACKET_ON_SAME_LINE'))
            {
                
    $files preg_replace("/(\n)+(\s)*\{/s""{"$files);
                
    $files preg_replace("/(\r\n)+(\s)*\{/s""{"$files);
            }
            
            
    // Remove unwanted spaces
            
    $files preg_replace("/( )+/s"" "$files);
            
            
    // Compiled files' header
            
    $files '<?php' LINEBREAK .                  
                     
    '// This is a generated files which contains all files from ' $this->dir LINEBREAK .
                     
    '// Compiled for a speed issue ' LINEBREAK .
                     
    '// Do not edit this file. Instead, edit the file into ' $this->dir ' and recompile all' LINEBREAK .
                     
    $files LINEBREAK .
                     
    '?>';
            
            
    // Put all files into a single one
            
    if (!$fp fopen($this->file'w+'))
            {
                
    trigger_error('Cannot open file ' $this->file);
            }
            
            
    fwrite($fp$filesstrlen($files));
            
    fclose($fp);
            
            
    // Finished
            
    echo '<h5 style="font-family : Verdana">Compilation succeeded</h5>';
        }
    }

    // Compile
    $compiler =& new Compiler();

    ?>
    How to use it :

    1. Change the ROOT constant value to your root relative path.
    2. Edit the dir attribute to your lib directory.
    3. Edit the file attribute to the file which will contain all classes.

    Here's the result:
    Before
    PHP Code:
        /**
         * Compile et retourne le code html compilé.
         *
         * @return string Le code qui vient d'être compilé.
         *
         * @access public
         * @since  1.0
         */
        
    function parse()
        {
            
    $template $this->uncompiled;

            
    // Pré-compilation
            
    $this->preParse($template);
            
            
    // Compile les mots
            
    $this->parseLang($template);
            
            
    // Compile les variables simples
            
    foreach ($this->vars as $handle => $value)
            {
                
    $template str_replace('{' $handle '}'$value$template);
            }
            
            
    // Toute les définitions et les remplacements sont stoqués dans des
            // tableau pour simplement tous les passer dans str_replace question
            // de gagner de la rapidité
            
    $defs = array();
            
    $repl = array();        
            
            
    // Compile uniquement les bloques qui ont eut des variables assignées
            
    foreach ($this->blockVars as $name => $instances)
            {
                
    // Cherche un bloque qui a comme nom le contenu de $name et retourne
                // sa définition et le contenu du code.
                
    if ($this->getBlock($template$name$def$code))
                {
                    
    // Liste des instances du bloque compilée
                    
    $list = array();
                    
                    
    $size sizeof($instances);
                    
                    
    // Compile toute les instances du bloque
                    
    for ($i 0$i $size$i++)
                    {
                        
    $list[$i] = $code;

                        foreach (
    $instances[$i] as $handle => $value)
                        {
                            
    $list[$i] = str_replace('{' $name '.' $handle '}'$value$list[$i]);
                        }
                    }
                    
                    
    $defs[] = $def;
                    
    $repl[] = implode(''$list);
                }
            }

            
    // Remplace toutes des définitions de bloque par leur remplacements
            // c'est à dire leur remplacement compilés
            
    $template str_replace($defs$repl$template);

            
    $this->clean($template);
            
    $this->reset();

            return 
    $template;
        } 
    After

    PHP Code:
    function parse(){
            
    $template $this->uncompiled;
            
    $this->preParse($template);
            
    $this->parseLang($template);
            foreach (
    $this->vars as $handle => $value){
                
    $template str_replace('{' $handle '}'$value$template);
            }
            
    $defs = array();
            
    $repl = array();        
            foreach (
    $this->blockVars as $name => $instances){
                if (
    $this->getBlock($template$name$def$code)){
                    
    $list = array();
                    
    $size sizeof($instances);
                    for (
    $i 0$i $size$i++){
                        
    $list[$i] = $code;
                        foreach (
    $instances[$i] as $handle => $value){
                            
    $list[$i] = str_replace('{' $name '.' $handle '}'$value$list[$i]);
                        }
                    }
                    
    $defs[] = $def;
                    
    $repl[] = implode(''$list);
                }
            }
            
    $template str_replace($defs$repl$template);
            
    $this->clean($template);
            
    $this->reset();
            return 
    $template;
        } 
    Fell free to post any comments
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  2. #2
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good idea. Sean at mojavi.org uses a bash script to merge the separate classes to a simple 'mojavi-all-classes.php' file.

    And why do I get the feeling I've seen you over there before? ;)

  3. #3
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Huh ? over where ?
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  4. #4
    SitePoint Member
    Join Date
    Jan 2004
    Location
    Continente de São Pedro
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont get how it will increase speed...

  5. #5
    SitePoint Member k3nny's Avatar
    Join Date
    Mar 2004
    Location
    Pretoria
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont get how it will increase speed...
    It increases speed by lowering the number of times PHP needs to read files from disk, remove comments and whitespace while parsing the file. The time saved on disc reads can add up very quickly on older discs...

    mr_jeep: thanks for the script, I know I'll be using it a lot!

  6. #6
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For PHP5: php_strip_whitespace() could be used to strip out all the comments.

  7. #7
    SitePoint Guru
    Join Date
    May 2003
    Location
    virginia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi! Do you have a download link for this class?

    Matt

  8. #8
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mwmitchell
    Hi! Do you have a download link for this class?

    Matt
    Yep, I'll be posting one soon
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  9. #9
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  10. #10
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great idea, but do you have any more examples ??

  11. #11
    SitePoint Wizard Dangermouse's Avatar
    Join Date
    Oct 2003
    Posts
    1,024
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesnt php -w do this?

  12. #12
    SitePoint Enthusiast robsynnott's Avatar
    Join Date
    Mar 2004
    Location
    Ireland
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Correct me if I'm wrong, but I think PHP pre-compiles scripts before running; it's not a pure interpreted language. Do you have any concrete examples of this thing improving running speed?
    Rob.
    http://ads.synnottsoftware.com
    Free Banner Text and Popup Exchange
    http://www.synnottsoftware.com/adsenseanalysis
    AdSense CSV Report analysis tool

  13. #13
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    PHP compiles scripts into an intermediate language (Zend Intermediate Lanuage) before running them. In a way this class could help by reducing disk accesses and such but in larger applications you don't want all your objects and functions in memory if you're just going to be using one or two.

  14. #14
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll post another example and show how It could improve speed. But I think some pple miss the point of this class
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  15. #15
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couple of links - http://www.php.net/tokenizer - displays the "tokens" generated by the PHP parser from your source code - you could use this as a basis for regenerating a script (as opposed to regular expressions)

    http://pear.php.net/package/PHP_Parser - low revision number but build on top of the PHP tokenizer to reconstruct the grammar of PHP and present it in a useful array.

  16. #16
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Example and speed advantages

    Hi, I said I'd show an example and show how merging files together can increase speed, here I go.

    First of all, here's my directory tree :

    admin/
    /doc/
    /image/
    /include/
    /lib/
    /lib/Cookie.php
    /lib/Db.php
    /lib/DbMysql.php
    /lib/...
    /setup/
    /setup/compile.php

    1. Edit the compile.php file's attribute $file, $dir and constant ROOT

    PHP Code:
    define('ROOT''../');
    define('LINEBREAK'"\n");
    define('BRACKET_ON_SAME_LINE'1);

    /**
     * "Compiler" Class. This class reads all files from a directory and merge them
     * into a big one. Very usefull to get some speed if, in each pages, you
     * include a lot of differents files.
     *
     * @author  Jean-Philippe Déry <jeanphilippe_dery@hotmail.com>
     * @version 1.0
     */
    class Compiler
    {
        
    /**
         * Compile each files from this directory.
         *
         * @var    string
         * @access private
         * @since  1.0
         */
        
    var $dir  'lib/';
        
        
    /**
         * Compiled file.
         *
         * @var    string
         * @access private
         * @since  1.0
         */
        
    var $file 'include/all.php';

                 
    /* .... */ 
    First, I define my ROOT value. Since compile.php is in /setup, the relative root would be one directory behind so ../ If you would like to compile all files in /home/username/www/test/lib/ and your compile.php is in /var/www/php/compile.php then your relative root would be ../../../

    Now you must set the $dir attribute. This attribute is the directory where all your lib files are. The path must be from your root dir and must end and a / like lib/ for the first case and home/username/www/test/lib/ for the second case

    Finally set the path (from your root) where the all-in-one file will be written with the $file attribute.

    If this ROOT thing confuse you, simply leave it blank and set a full path to both $dir and $file attribute.

    2. Execute the script. You should see something like this (but with your files)

    Code:
    Compile file Cookie.php ............ done
    Compile file Db.php ....................... done
    Compile file DbMysql.php ............. done
    Compile file File.php .................. done
    Compile file Form.php ............................ done
    Compile file FormFactory.php ......... done
    Compile file FormOutput.php ................................. done
    Compile file FormValidator.php ...................... done
    Compile file Header.php ....... done
    Compile file Layout.php .................... done
    Compile file Mail.php .. done
    Compile file Module.php ............. done
    Compile file ModuleAdmin.php .............. done
    Compile file Navbot.php ..... done
    Compile file Navleft.php ...... done
    Compile file NavLeftAdmin.php .... done
    Compile file Navtop.php ..... done
    Compile file Navtree.php ........ done
    Compile file Output.php .............. done
    Compile file PgOutput.php ......................... done
    Compile file PgOutputAdmin.php ....................... done
    Compile file ResultSet.php ........... done
    Compile file ResultSetMysql.php ......... done
    Compile file Session.php .................. done
    Compile file Std.php ........... done
    Compile file System.php ........................... done
    Compile file Template.php ................................. done
    Compile file TemplateFactory.php ............. done
    Compile file TemplateFileFactory.php .............. done
    Compile file User.php ........................... done
    Compile file Widget.php ................................................................................. done
    Compile file Zipfile.php ................................... done
    
    Compilation succeeded
    Now the test :

    The script was timed this way :

    PHP Code:
    $stimer explode' 'microtime() );
    $stimer $stimer[1] + $stimer[0];

    // Time this...

    $etimer explode' 'microtime() );
    $etimer $etimer[1] + $etimer[0];
    echo 
    '<p style="margin:auto; text-align:center">';
    printf"Script timer: <b>%f</b> seconds.", ($etimer-$stimer) );
    echo 
    '</p>' 
    ;

    Every pages has been timed 3 times

    Results :

    Without using the compiled class :
    Script timer: 0.193107 seconds.
    Script timer: 0.143650 seconds.
    Script timer: 0.137079 seconds

    Using the compiled class :
    Script timer: 0.083128 seconds.
    Script timer: 0.079790 seconds.
    Script timer: 0.082525 seconds.

    Here's where I include the compiled file:
    PHP Code:
    <?php
    // +---------------------------------------------------------------------------+
    // | Framework for Php4                                                        |
    // |---------------------------------------------------------------------------+
    // | Author : Jean-Philippe Déry <jeanphilippe_dery@hotmail.com>               |
    // +---------------------------------------------------------------------------+
    // | This program is free software; you can redistribute it and/or modify      |
    // | it under the terms of the GNU General Public License as published by      |
    // | the Free Software Foundation; either version 2 of the License, or         |
    // | (at your option) any later version.                                       |
    // +---------------------------------------------------------------------------+

    // Définit le niveau d'affichage d'erreur
    error_reporting(E_ALL);

    // Constantes & configurations
    require_once ROOT 'include/constants.php';

    // Charge le fichier contenant toute les classes compilée si il existe sinon
    // on inclus tous les fichier requis un par un.
    if (is_readable(ROOT 'include/all.php'))
    {
        require_once 
    ROOT 'include/all.php';    
    }
    else
    {
        
    // Libraries
        
    require_once ROOT 'lib/Cookie.php';
        require_once 
    ROOT 'lib/Db.php';
        require_once 
    ROOT 'lib/DbMysql.php';
        require_once 
    ROOT 'lib/File.php';
        require_once 
    ROOT 'lib/Module.php';
        require_once 
    ROOT 'lib/ModuleAdmin.php';
        require_once 
    ROOT 'lib/ResultSet.php';
        require_once 
    ROOT 'lib/ResultSetMysql.php';
        require_once 
    ROOT 'lib/Session.php';
        require_once 
    ROOT 'lib/Std.php';
        require_once 
    ROOT 'lib/System.php';
        require_once 
    ROOT 'lib/Template.php';
        require_once 
    ROOT 'lib/TemplateFactory.php';
        require_once 
    ROOT 'lib/TemplateFileFactory.php';
        require_once 
    ROOT 'lib/User.php';
        
        
    // Output
        
    require_once ROOT 'lib/PgOutput.php';
        require_once 
    ROOT 'lib/PgOutputAdmin.php';
        require_once 
    ROOT 'lib/Output.php';
        require_once 
    ROOT 'lib/Header.php';
        require_once 
    ROOT 'lib/Layout.php';
        require_once 
    ROOT 'lib/Navleft.php';
        require_once 
    ROOT 'lib/NavleftAdmin.php';
        require_once 
    ROOT 'lib/Navtop.php';
        require_once 
    ROOT 'lib/Navtree.php';
        require_once 
    ROOT 'lib/Navbot.php';
        
        
    // Formulaires
        
    require_once ROOT 'lib/FormFactory.php';
        require_once 
    ROOT 'lib/FormValidator.php';
        require_once 
    ROOT 'lib/Form.php';
        require_once 
    ROOT 'lib/FormOutput.php';
        require_once 
    ROOT 'lib/Widget.php';
    }
    ?>
    Thanks for reading
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  17. #17
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I was being paid to spend an afternoon improving performance, and all I had to show for it was a speed gain of 8 hundredths of a second, I think I'd have some explaining to do.

    I don't mean to be unkind - perhaps in some situations it could be useful - but I would expect that with most php apps any gains which might be obtained will not be significant.

    I think I see two main classes here: a (re-usable) DirectoryIterator which could be decorated with a (easily replacable) FileParser (and probably separate FileRead and FileWrite classes as well).

    I'd also be looking for a way to compile a range of files with just the classes/fns required for the current script rather just one for the entire app.

  18. #18
    SitePoint Zealot mr_jeep's Avatar
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I was being paid to spend an afternoon improving performance, and all I had to show for it was a speed gain of 8 hundredths of a second, I think I'd have some explaining to do
    ((0.193107 + 0.143650 + 0.137079) / 3) / (( 0.083128 + 0.079790 + 0.082525) / 3) = ~ 2.18 x faster if I'm correct. Beside, I don't think I can expect a non optimised website to run a way faster than 0.1 seconds. In this case, I get 0.08 seconds. To me, it's a nice optimisation and don't forget I didn't spent a afternoon building this class.

    I think I see two main classes here: a (re-usable) DirectoryIterator which could be decorated with a (easily replacable) FileParser (and probably separate FileRead and FileWrite classes as well).
    Your are right.

    I'd also be looking for a way to compile a range of files with just the classes/fns required for the current script rather just one for the entire app.
    Ok. I made this class for my needs. After I though maybe someone else might like to do this so I shared it. It was not ment to be a "super-compiler-php-script-increase-speed-by-2000%" but a simple "merge-all-files-into-one" script. It this class meet your needs then use it else, ignore it.

    Thanks
    I'd appreciate if you would tell me if something I wrote is spelled wrong

  19. #19
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    edited

  20. #20
    SitePoint Member
    Join Date
    Jun 2004
    Location
    Planet Earth
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something McGruff has failed to relise is time and access numbers, a site taking a thousand hits a minute would benifit from this, not only in speed but in the long run even the electricity bill would be a lil cheaper.

    Good job mr_jeep, you truly have a good understanding of real computing. Keep it up!

  21. #21
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It might benefit even more from some new hardware.

  22. #22
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    Chicago
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by McGruff
    It might benefit even more from some new hardware.
    Not everyone has the benifit of a dedicated server. This little difference mounts up.... Say you have a page with 6 library includes. 50 people visit the page in a minute, so thats at least 6 * 50 = 300 I/O ops per a minute. Add another 50 for the page itself, and thats 350 a minute. With the compiler, its 100 I/O ops per a minute. Thats a very large reduction, and is worth the benefits. It's not like this really costs development time or anything; you just use your dev libraries and "compile" for the final release. Leave the dev dirs in incase someone wants to make modifications.

    I actually use something exactly like this

  23. #23
    simple tester McGruff's Avatar
    Join Date
    Sep 2003
    Location
    Glasgow
    Posts
    1,690
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Aesthetic-Theory
    Not everyone has the benifit of a dedicated server
    But anyone can upgrade to one - or to a better shared host.

    Quote Originally Posted by Aesthetic-Theory
    Thats a very large reduction, and is worth the benefits.
    It depends to a certain extent what you regard as a significant reduction. There would be no noticable difference between a script with 6 includes and a script with 2. Hubble space telescope territory, I think.

  24. #24
    SitePoint Enthusiast
    Join Date
    Jun 2003
    Location
    Chicago
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by McGruff
    But anyone can upgrade to one - or to a better shared host.


    It depends to a certain extent what you regard as a significant reduction. There would be no noticable difference between a script with 6 includes and a script with 2. Hubble space telescope territory, I think.
    Clients can be limited by monetary issues. I think this script is useful because it doesn't really require any aditional work, it just provides the benefit.

    "Why am I the only here who is arguing that the parsing/processing time for a massive file might offset the gains from skipping IO time?"

    They are parsed either way, so I don't think that would matter.

  25. #25
    SitePoint Enthusiast
    Join Date
    Aug 2000
    Location
    Bay Area, CA; (Pasadena, CA this fall)
    Posts
    61
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Aesthetic-Theory
    "Why am I the only here who is arguing that the parsing/processing time for a massive file might offset the gains from skipping IO time?"

    They are parsed either way, so I don't think that would matter.
    So it's assumed that all files in the library are needed for every page?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •