简体   繁体   English

Firebug 和性能问题?

[英]Firebug & Performance Question ?

i wanted to know somethings about the firebug, when i try to load a page with firebug opend, it start the time lines.我想知道一些关于萤火虫的事情,当我尝试加载一个打开萤火虫的页面时,它会启动时间线。

what is:什么是:

waiting, reciving, DomContentLoaded, Load,等待,接收,DomContentLoaded,加载,

mysql queries what affect from the list? mysql 从列表中查询有什么影响? i see that more mysql queries i am adding, the reciving part is increasing.我看到我正在添加更多的 mysql 查询,接收部分正在增加。

let me paste a request that ihave used on my core, to generate a dynamic link or content.让我粘贴一个我在核心上使用过的请求,以生成动态链接或内容。

function getContent($id = '') {
    $id = mysql_real_escape_string ($id);
    $sql = 'SELECT id,post_title,post_content FROM wp_posts WHERE post_category="67" ORDER BY post_date DESC LIMIT 1';
    $res = mysql_query($sql) or die (mysql_error());    

if (mysql_num_rows($res) !=0):
    while ($row = mysql_fetch_assoc($res)) {


    // this remove caption from wordpress, get 450 words to be used for exerpt, encode html,
    $mycontent = $row['post_content'];
    $mycontent = strip_tags($mycontent);
    $mycontent = substr($mycontent,0,250);
    $mycontent = preg_replace("/\[caption.*\[\/caption\]/", '', $mycontent); 
    $mycontent = htmlentities($mycontent);

    //encode the words for html
    $title = $row['post_title'];
    $title = htmlentities($title);

    echo '


    <<h1><a href="single.php?id='.$row['id'].'">'.$title.'</a> </h1>
    <div class="cssclass"> '.$mycontent.' </div>


    '; //echo
}
    else:
        echo 'This page dosnt exist.';
    endif;
} // end 

Is any thing wrong on this code or its normal, my db is about 75.000 lines.这段代码或其正常有什么问题吗,我的数据库大约是 75.000 行。

Thank you for reading this post.感谢您阅读这篇文章。

waiting: after sending a request to the server, this is the time spent waiting for data to start coming back等待:向服务器发送请求后,等待数据开始返回所花费的时间

receiving: time spent receiving content接收:接收内容所花费的时间

DomContentLoaded: time spent until the entirety of the DOM is availble (note, this is not all resources loaded, just the html portions, eg the </html> tag has been received/processed). DomContentLoaded:在整个 DOM 可用之前所花费的时间(注意,这不是加载所有资源,只是 html 部分,例如</html>标记已被接收/处理)。

load: time until the entirety of the page, including images/scripts/css has been received/processed/loaded.加载:直到整个页面(包括图像/脚本/css)被接收/处理/加载的时间。

Don't worry about the receiving portion increasing.不用担心接收部分会增加。 You're outputting more data, so it'll take more time to receive.您正在输出更多数据,因此需要更多时间来接收。 That's perfectly normal.这是完全正常的。

Waiting is the time between when the browser sends the request and receiving any data at all from the server.等待是浏览器发送请求和从服务器接收任何数据之间的时间。

Receiving is the time actually getting data.接收是实际获取数据的时间。

The reason Receiving is longer is because you're sending more data, so it's taking longer to download.接收时间更长的原因是因为您发送的数据更多,因此下载时间更长。 You might expect Waiting time to go up slightly too, but the time to transfer across the network is more significant than the time spent processing the data on the server.您可能期望 go 的等待时间也略有增加,但是通过网络传输的时间比在服务器上处理数据所花费的时间更重要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM