Announcement

Collapse
No announcement yet.

Script for Benchmarking and speeding up Actinic

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Script for Benchmarking and speeding up Actinic

    I have been benchmarking the various components i write in php. this is to ensure that they dont super slowdown peoples built times.

    i thought you might want to use the code i used, to benchmark and speed up your own sites. Its php.

    Put this FIRST BEFORE ANY OTHER TEXT, in a primary template:
    Code:
    <actinic:block php="true" >
    $starttime = microtime();
    $startarray = explode(" ", $starttime);
    $starttime = $startarray[1] + $startarray[0];	
    </actinic:block>
    Put this JUST BEFORE </body>
    Code:
    <actinic:block php="true" >
    $endtime = microtime();
    $endarray = explode(" ", $endtime);
    $endtime = $endarray[1] + $endarray[0];
    $totaltime = $endtime - $starttime;
    $totaltime = round($totaltime,5);
    echo "This page loaded in $totaltime seconds.";
    
    $myFile = "C:\\actBenchmark.txt";
    $fh = fopen($myFile, 'a') or die("can't open file");
    $stringData = $totaltime."\t<actinic:variable name="SectionURL" selectable="false" />\n";
    fwrite($fh, $stringData);
    fclose($fh);
    </actinic:block>
    Now, at the footer of every page, the time it took for actinic to generate that page, is displayed, in seconds/ms.

    A file will be generated on first run. everytime you preview a page, its render time and filename will be logged.
    it is located at 'C:\actBenchmark.txt'

    I had these blocks surrounded by simple 'DebugPageSpeed' variables, that was set to 'true' when i want to debug and 'false' when i wasnt debugging.

    have fun.

    #2
    Nice one Gabe


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      every little helps *pats ass twice*

      yes yes, i'm well aware that this is an amalgam of two distinct slogans

      Comment


        #4
        Actinet ClubCard ... that is your next project.....


        Bikster
        SellerDeck Designs and Responsive Themes

        Comment


          #5
          Originally posted by jont
          Actinet ClubCard ... that is your next project.....
          I think Gabe has that one in hand
          http://www.interact-studio.co.uk/int...designers.html
          Tracey

          Comment

          Working...
          X