Page 2 of 2 FirstFirst 1 2
Results 16 to 24 of 24

Thread: Which is faster ?

  1. #16
    Join Date
    Aug 2001
    Location
    Ampang KL
    Posts
    93
    Rep Power
    221
    Interesting findings..boleh masuk Discovery Research nih......

    Write PHP for Speed and Scalability

  2. #17
    Join Date
    Aug 2001
    Location
    Ampang KL
    Posts
    93
    Rep Power
    221

  3. #18
    Join Date
    Aug 2001
    Location
    Ampang KL
    Posts
    93
    Rep Power
    221
    Nih sesudah code diasingkan

    http://cms.arl.net.my/fallujah/test1.php
    Keputusan 500 request AB Bench
    PHP Code:
    [www@devel fallujah]$ /usr/local/apache/bin/ab -n500 [url]http://cms.arl.net.my/fallujah/test1.php[/url]
    This is ApacheBenchVersion 1.3d <$Revision1.70 $> apache-1.3
    Copyright 
    (c1996 Adam TwissZeus Technology Ltd, [url]http://www.zeustech.net/[/url]
    Copyright (c1998-2002 The Apache Software Foundation, [url]http://www.apache.org/[/url]

    Benchmarking cms.arl.net.my (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software
    :        Apache/1.3.29
    Server Hostname
    :        cms.arl.net.my
    Server Port
    :            80

    Document Path
    :          /fallujah/test1.php
    Document Length
    :        2470 bytes

    Concurrency Level
    :      1
    Time taken 
    for tests:   67.816 seconds
    Complete requests
    :      500
    Failed requests
    :        0
    Broken pipe errors
    :     0
    Total transferred
    :      1317500 bytes
    HTML transferred
    :       1235000 bytes
    Requests per second
    :    7.37 [#/sec] (mean)
    Time per request:       135.63 [ms] (mean)
    Time per request:       135.63 [ms] (meanacross all concurrent requests)
    Transfer rate:          19.43 [Kbytes/secreceived

    Connnection Times 
    (ms)
                  
    min  mean[+/-sdmedian   max
    Connect
    :        2    76  731.5      3  9001
    Processing
    :    51    59   15.9     53   281
    Waiting
    :       48    58   15.9     52   280
    Total
    :         51   135  731.7     57  9049

    Percentage of the requests served within a certain time 
    (ms)
      
    50%     57
      66
    %     59
      75
    %     65
      80
    %     77
      90
    %     82
      95
    %     96
      98
    %    123
      99
    %   3046
     100
    %   9049 (last request
    http://cms.arl.net.my/fallujah/test2.php
    Keputusan 500 request AB Bench
    PHP Code:
    [www@devel fallujah]$ /usr/local/apache/bin/ab -n500 [url]http://cms.arl.net.my/fallujah/test2.php[/url]
    This is ApacheBenchVersion 1.3d <$Revision1.70 $> apache-1.3
    Copyright 
    (c1996 Adam TwissZeus Technology Ltd, [url]http://www.zeustech.net/[/url]
    Copyright (c1998-2002 The Apache Software Foundation, [url]http://www.apache.org/[/url]

    Benchmarking cms.arl.net.my (be patient)
    Completed 100 requests
    Completed 200 requests
    Completed 300 requests
    Completed 400 requests
    Finished 500 requests
    Server Software
    :        Apache/1.3.29
    Server Hostname
    :        cms.arl.net.my
    Server Port
    :            80

    Document Path
    :          /fallujah/test2.php
    Document Length
    :        2338 bytes

    Concurrency Level
    :      1
    Time taken 
    for tests:   76.994 seconds
    Complete requests
    :      500
    Failed requests
    :        0
    Broken pipe errors
    :     0
    Total transferred
    :      1251500 bytes
    HTML transferred
    :       1169000 bytes
    Requests per second
    :    6.49 [#/sec] (mean)
    Time per request:       153.99 [ms] (mean)
    Time per request:       153.99 [ms] (meanacross all concurrent requests)
    Transfer rate:          16.25 [Kbytes/secreceived

    Connnection Times 
    (ms)
                  
    min  mean[+/-sdmedian   max
    Connect
    :        2    95  766.0      4  9020
    Processing
    :    48    59   19.7     52   331
    Waiting
    :       46    58   19.6     51   330
    Total
    :         48   154  766.1     56  9076

    Percentage of the requests served within a certain time 
    (ms)
      
    50%     56
      66
    %     61
      75
    %     68
      80
    %     75
      90
    %     88
      95
    %    105
      98
    %    221
      99
    %   3048
     100
    %   9076 (last request

  4. #19
    Join Date
    Aug 2001
    Location
    Ampang KL
    Posts
    93
    Rep Power
    221
    Kesimpulan dari data di atas

    Kalau guna $data[] dan implode lagi laju dalam skala besar ( 500 requests )
    Time taken for tests: 67.816 seconds

    Kalau guna $data .= pula dapat
    Time taken for tests: 76.994 seconds

    Dekat 9 saat beza dia

  5. #20
    Join Date
    Apr 2002
    Location
    kuantan, pahang
    Posts
    58
    Rep Power
    213
    semalam sebelum solat jumaat aku run script ni
    1) menggunakan "$variable" dalam "
    fail "compare.php":
    PHP Code:
    <?
    function getmicrotime()
    {
        list(
    $usec$sec) = explode(" ",microtime());
        return ((float)
    $usec + (float)$sec);
    }

        echo 
    '(using " )<br>';
        
    $script_start getmicrotime();
        for (
    $i=$i<100$i++){
            
    $burung="$i ayam";
            
    $selsema="$i Selsema $burung";
            
    $itik ="$i itik serati";
            
    $sakit="$i mati";
            echo 
    "$selsema boleh menjadi sebab $burung dan $itik $sakit<br>";
            unset(
    $burung);
            unset(
    $selsema);
            unset(
    $itik);
            unset(
    $sakit);
        }
        
    $script_end=getmicrotime();
        
    $time=$script_end-$script_start;
        unset(
    $script_end);
        unset(
    $script_start);
        echo 
    '(using  ") '.$i.' times<br>';
        echo 
    '<br>Time taken:' sprintf("%.9f",$time) . 'secs';
        echo 
    '<br><a href="comparea.php" >satu lagi</a>';
        echo 
    '<br><br><br>';
        include_once(
    "ez_sql.php");
        
    $db->query("INSERT into comparison (type,second) VALUES ('double','$time')");
        unset(
    $time);
        unset(
    $i);
        echo 
    "<meta http-equiv='refresh' content='3; url=comparea.php'>";

    ?>
    menggunakan '.$variable.' dalam '
    fail comparea.php
    PHP Code:
    <?

    function getmicrotime()
    {
        list(
    $usec$sec) = explode(" ",microtime());
        return ((float)
    $usec + (float)$sec);
    }

        echo 
    "(using  ')<br>";
        
    $script_start getmicrotime();
        for (
    $i=$i<100$i++){
            
    $burung=$i.' ayam';
            
    $selsema=$i.' Selsema ' .$burung;
            
    $itik =$i.' itik serati';
            
    $sakit=$i.' mati';
            echo 
    $selsema.' boleh menjadi sebab '.$burung.' dan '.$itik.' '.$sakit.'<br>';
            unset(
    $burung);
            unset(
    $selsema);
            unset(
    $itik);
            unset(
    $sakit);
        }
        
    $script_end=getmicrotime();
        
    $time=$script_end-$script_start;
        unset(
    $script_end);
        unset(
    $script_start);
        echo 
    '(using  \\''.$i.' times<br>';
        echo '
    <br>Time taken:' . sprintf("%.9f",$time) . 'secs';
        echo '
    <br><a href="compare.php" >satu lagi</a>';
        echo '
    <br><br><br>';
        include_once("ez_sql.php");
        $db->query("INSERT into comparison (type,second) VALUES ('
    single','$time')");
        unset($time);
        unset($i);
        echo "<meta http-equiv='
    refresh' content='3url=compare.php'>";

    ?>
    ringkasannye ape yang script ni buat ialah bila kita buka browser,
    1)akan run script dan kira masa
    2)masukkan masa yang digunakan ke dalam database (table 'comparison'
    3)guna meta tag untuk refresh ke fail satu lagi.

    dan seterusnya vis-a-vis hingga browser ditutup

    sejam kemudian, aku buat query
    "SELECT COUNT(*) as bil, AVG(second) as average, type FROM comparison GROUP BY type"

    result yang aku dapat ialah:

    bil average type
    ___ _______ ____
    485 0.0013938077946299 double
    486 0.00097305980729468 single

    keputusannya secara average, menggunakan single quotes adalah lebih laju

    Last edited by Gemp-X; 02-10-2004 at 01:16 PM.

  6. #21
    Join Date
    Nov 2001
    Location
    Johor
    Posts
    772
    Rep Power
    232
    kembang la LCF tu
    I hate when:

    vBulletin Message:
    Sorry! The administrator has specified that users can only post one message every 60 seconds

  7. #22
    Join Date
    Jun 2001
    Location
    Mystic Kingdoms
    Posts
    2,749
    Rep Power
    277
    gila.. mabuk aku dibuatnya menengok kan code nih

    eh.. which is faster arr?
    a template in :
    *.tpl
    *.php
    *.htm / html

    i mean, while using include("xx.xx");

    which one is faster and why?

  8. #23
    Join Date
    Apr 2002
    Location
    kuantan, pahang
    Posts
    58
    Rep Power
    213
    aku rase same je semuanya dari segi speed,
    aku prefer guna .php & kat atas sekali dalam setiap template tu letak :
    PHP Code:
    <!-- <?  die("ape ko nak!!");  ?> -->
    jadi orang takleh la nak bukak fail template tu sahaja directly , sebab dia akan parse as PHP.

    normally sebagai template, dia akan render code di atas sebagai html comment i.e tak keluar la kat output browser

  9. #24
    Join Date
    Aug 2001
    Location
    Ampang KL
    Posts
    93
    Rep Power
    221
    mystic
    guna ob

    katakan nak echo content template

    ob_start("ob_gzhandler");
    $smarty->display("index.tpl");
    exit;

Page 2 of 2 FirstFirst 1 2

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Looking for Faster Server
    By amanz in forum Paid Hosting Discussion Forum
    Replies: 7
    Last Post: 18-12-2014, 07:00 PM
  2. VPN services for a faster and secure download
    By CheetahVPN in forum Showcase
    Replies: 0
    Last Post: 21-10-2009, 01:39 PM
  3. The Faster Online Service to build online your Business
    By kingrapid in forum Other Webmaster-related Services and Promotion
    Replies: 0
    Last Post: 26-06-2009, 05:18 AM
  4. Make Google index your site faster
    By jawa in forum Other Internet Marketing Methods
    Replies: 15
    Last Post: 11-12-2004, 03:51 PM

Posting Permissions

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

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32