2

I have a website that generates lots of dynamic contents. I'm facing performance issues even on my localhost, on a Corei7 processor.

I've tried to disable every unnecessary plugin, and ran p3 performance profiler to see the results. The resulting charts show that most of the loading time is spent on WordPress's core (not plugins).

I'm using simple functions like if() and bloginfo('name') and call metadatas like get_post_meta() and the_permalink() a lot of times on my pages, one could say maybe up to 50 functions in each page.

These functions seem very simple, however i'm not sure how much impact do they have on loading time.

Is there a way to find out which parts of the page consume the most time? or is there a general guide to understand how much impact does these functions have on WordPress?

Thanks are in orders.

2
  • Have you first tried some simple analysis, like using the online Google page insights, or the firefox plugin 'yslow'? Might give you some more clues.
    – C C
    Jan 25, 2017 at 21:00
  • Unfortunately Y!slow no longer works on firefox. However i used the website and it tells me that my server's bandwidth is low. I have performance issues even on localhost tho. This wordpress performance issue is so common, and it has dozens of questions asked already.
    – Johansson
    Jan 26, 2017 at 0:29

2 Answers 2

3

The overhead of PHP function as a mechanism is minimal. After all nearly everything going on is function calls. On a reasonable hardware you will have to ramp up function calls into thousands and tens of thousands to generate significant overhead (as opposed to doing same things with less function calls involved).

Worth noting that PHP profilers tend to overestimate the impact of function calls. Xdebug is especially eager to do that. More so just having Xdebug enabled can slow things down in environment heavy on function calls.

P3 profiler uses PHP ticks mechanism to profile, which is highly unreliable.

For any realistic outlook into performance you need to use a profiler that works on PHP engine level, such as Xdebug or Blackfire. In lack of such your performance troubleshooting options are very limited and basically amount to stuffing code with timers and ripping it apart until you figure out the slow part.

0
1

p3 performance profiler

This plugin worked well, but now I found it is not a good quality anymore. Have you noted the same?

You should relax and let the web server do stuff. Pick smart plugins from trusted authors.

When you write themes or plugins do as much as possible ob_start() magic to buffer your output.

I wish PHP will become ahead of time, and thus faster.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.