Php framework-thinkphp is slow. Why? Code pasted

Source: Internet
Author: User
Tags id3
2.9978 s (Load: 0.0130 sInit: 0.0047 sExec: 2.9360 sTemplate: 0.0441 s) throughput: 0.33reqs find a solution what does Exec mean {code ...} 2.9978 s (Load: 0.0130 s Init: 0.0047 s Exec: 2.9360 s Template: 0.0441 s)
Throughput: 0.33req/s
Solutions

What does Exec mean?


  
  

  • Bookmarks
  • Bookmarks

{/* Span1 end */}

  • Class = "active"> All Categories
  • Class = 'active'>{$ P. bookmarkcategory_name}

{/* Span1 end */}

Add bookmarks

{$ SC. bookmarkcategory_name} All-open

{$ Vo. bookmark_name}
Bytes Bytes

{/* Span10 end */}

{/* Sui-row-fluid end */}Script $ (document ). ready (function () {$ ("# create "). click (function () {layer. open ({type: 2, {/* 0 (information box, default) 1 (page layer) 2 (iframe layer) 3 (loading layer) 4 (tips layer) */} title: 'add bookmarks ', shadeClose: true, {/* Whether to click the mask to close */} shade: [0.3], area: ['700px ', '750px '], content: "_ MODULE _/Bookmark/createBookmark", closeBtn: 1, {/* 0 indicates that there is no close button. 1 is a small close button. 2 is a rounded corner close button. */} shift: 0, {/* animation 0 is not 1-6 */} maxmin: true, {/* display the smallest button */} // skin: 'layui-layer-rim ', // Add the border cancel: function () {location. reload () ;}, end: function () {location. reload () ;},}) ;}; function re () {{/ * batch pop-up url start */} $ ('# Openurl _ {$ SC. bookmarkcategory_id}'). click (function () {var id = "{$ SC. bookmarkcategory_id }"; If (id = "{$ vo. bookmark_cid}") {window. open ('HTTP: // {$ vo. bookmark_url }');} }); {/* Batch pop-up url end */} {/* The control start */} is displayed when the cursor is reached */} $ ("# Url _ {$ vo. bookmark_id }"). mouseover (function () {$ ("# displayurl _ {$ vo. bookmark_id }"). show () ;}); $ ("# url _ {$ vo. bookmark_id }"). mouseout (function () {$ ("# displayurl _ {$ vo. bookmark_id }"). hide ();}); {/* Show the control end */} {/* drag and drop the sort start */} Var el = document. getElementById ('item _ {$ SC. bookmarkcategory_id} '); var sortable = new Sortable (el, {group: "{$ SC. bookmarkcategory_id} ", animation: 150, onUpdate: function (evt/** Event */) {// get the id var item = evt of the drag element. item; var iddd = item. innerHTML; // The Start Element id var startid =$ (iddd ). prop ("id"); // alert (startid); // gets whether the first var isone = evt has been moved. newIndex; // obtain the end element id if (evt. newIndex = 0) {// execute var id2 = evt.tar get when dragging to the first one. children [evt. newIndex + 1]; var id3 = id2.innerHTML; var endid = $(id3 ). prop ("id");} else {var id2 = evt.tar get. children [evt. newIndex-1]; var id3 = id2.innerHTML; var endid = $(id3 ). prop ("id");} $. get ("_ MODULE _/Bookmark/ajaxUpdateBookmarkSort/startid/" + startid + "/endid/" + endid + "/isone/" + isone, function (data, status) {if (data = 1) {// ajax success} else {// ajax failure}) ;}, // dragging ended }); {/* Drag and drop the sort end */} $ ("# {$ Vo. bookmark_id} _ update "). click (function () {layer. open ({type: 2, {/* 0 (information box, default) 1 (page layer) 2 (iframe layer) 3 (loading layer) 4 (tips layer) */} title: 'modify bookmarks ', shadeClose: true, {/* Whether to click the mask to close */} shade: [0.3], area: ['700px ', '750px '], content:' _ MODULE _/Bookmark/updateBookmark/id/{$ vo. bookmark_id} ', closeBtn: 1, {/* 0 indicates no close button. 1. A very small close button. 2. A rounded corner close button. */} shift: 0, {/* animation 0 No 1-6 */} maxmin: true, {/* display the smallest button */} // skin: 'layui-layer-rim ', // Add the border cancel: function () {$ ("# refresh "). load (location. href + "# refresh> *", function () {re () ;}, end: function () {$ ("# refresh "). load (location. href + "# refresh> *", function () {re ();});},});}); } Re (); {/* jquery end */}); script

Reply content:

2.9978 s (Load: 0.0130 s Init: 0.0047 s Exec: 2.9360 s Template: 0.0441 s)
Throughput: 0.33req/s
Solutions

What does Exec mean?


  
  

  • Bookmarks
  • Bookmarks

{/* Span1 end */}

  • Class = "active"> All Categories
  • Class = 'active'>{$ P. bookmarkcategory_name}

{/* Span1 end */}

Add bookmarks

{$ SC. bookmarkcategory_name} All-open

{$ Vo. bookmark_name}
Bytes Bytes

{/* Span10 end */}

{/* Sui-row-fluid end */}Script $ (document ). ready (function () {$ ("# create "). click (function () {layer. open ({type: 2, {/* 0 (information box, default) 1 (page layer) 2 (iframe layer) 3 (loading layer) 4 (tips layer) */} title: 'add bookmarks ', shadeClose: true, {/* Whether to click the mask to close */} shade: [0.3], area: ['700px ', '750px '], content: "_ MODULE _/Bookmark/createBookmark", closeBtn: 1, {/* 0 indicates that there is no close button. 1 is a small close button. 2 is a rounded corner close button. */} shift: 0, {/* animation 0 is not 1-6 */} maxmin: true, {/* display the smallest button */} // skin: 'layui-layer-rim ', // Add the border cancel: function () {location. reload () ;}, end: function () {location. reload () ;},}) ;}; function re () {{/ * batch pop-up url start */} $ ('# Openurl _ {$ SC. bookmarkcategory_id}'). click (function () {var id = "{$ SC. bookmarkcategory_id }"; If (id = "{$ vo. bookmark_cid}") {window. open ('HTTP: // {$ vo. bookmark_url }');} }); {/* Batch pop-up url end */} {/* The control start */} is displayed when the cursor is reached */} $ ("# Url _ {$ vo. bookmark_id }"). mouseover (function () {$ ("# displayurl _ {$ vo. bookmark_id }"). show () ;}); $ ("# url _ {$ vo. bookmark_id }"). mouseout (function () {$ ("# displayurl _ {$ vo. bookmark_id }"). hide ();}); {/* Show the control end */} {/* drag and drop the sort start */} Var el = document. getElementById ('item _ {$ SC. bookmarkcategory_id} '); var sortable = new Sortable (el, {group: "{$ SC. bookmarkcategory_id} ", animation: 150, onUpdate: function (evt/** Event */) {// get the id var item = evt of the drag element. item; var iddd = item. innerHTML; // The Start Element id var startid =$ (iddd ). prop ("id"); // alert (startid); // gets whether the first var isone = evt has been moved. newIndex; // obtain the end element id if (evt. newIndex = 0) {// execute var id2 = evt.tar get when dragging to the first one. children [evt. newIndex + 1]; var id3 = id2.innerHTML; var endid = $(id3 ). prop ("id");} else {var id2 = evt.tar get. children [evt. newIndex-1]; var id3 = id2.innerHTML; var endid = $(id3 ). prop ("id");} $. get ("_ MODULE _/Bookmark/ajaxUpdateBookmarkSort/startid/" + startid + "/endid/" + endid + "/isone/" + isone, function (data, status) {if (data = 1) {// ajax success} else {// ajax failure}) ;}, // dragging ended }); {/* Drag and drop the sort end */} $ ("# {$ Vo. bookmark_id} _ update "). click (function () {layer. open ({type: 2, {/* 0 (information box, default) 1 (page layer) 2 (iframe layer) 3 (loading layer) 4 (tips layer) */} title: 'modify bookmarks ', shadeClose: true, {/* Whether to click the mask to close */} shade: [0.3], area: ['700px ', '750px '], content:' _ MODULE _/Bookmark/updateBookmark/id/{$ vo. bookmark_id} ', closeBtn: 1, {/* 0 indicates no close button. 1. A very small close button. 2. A rounded corner close button. */} shift: 0, {/* animation 0 No 1-6 */} maxmin: true, {/* display the smallest button */} // skin: 'layui-layer-rim ', // Add the border cancel: function () {$ ("# refresh "). load (location. href + "# refresh> *", function () {re () ;}, end: function () {$ ("# refresh "). load (location. href + "# refresh> *", function () {re ();});},});}); } Re (); {/* jquery end */}); script

Exec is the program execution time,Load:0.0130s Init:0.0047s Exec:2.9360s Template:0.0441s
You used 0.0047 seconds for initialization. The execution program used 2.9360 seconds for template rendering. It took 0.0441 seconds.
Then you paste the template code.

This js Code is too stamp .. In addition, events are bound cyclically ..

Exec: the longest time consumption of 2.9360 s is here.

PHP code execution efficiency is low. It is either slow to check the database or PHP code when interacting with the database.

The tp itself is certainly okay. The possible reasons are as follows:

  1. Please copylocalhostChange127.0.0.1, Not onlytpThis problem occurs in many programs. I guess it may be related to the local computer configuration, but it is changed127.0.0.1No problem.

  2. Project reasons.

If every page is executed for a long time, it is basically problem 1. If the execution of a single page is slow, check a single page.
I guess it is the most likely problem 1.

Enable server logs for troubleshooting

It should be a problem with your internal php logic code! Execution time is too long

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.