WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 3 years ago

#1829 closed defect (fixed)

Improve performance of new O2 sites

Reported by: ocean90 Owned by:
Milestone: Priority: high
Component: Make (Get Involved) / P2 Keywords:
Cc:

Description

It seems like O2 isn't as fast as P2. One reason might be the number of queries:


Page: https://make.wordpress.org/meta/2016/06/08/plugin-directory-v3-chat-summary-61/

With O2: Time : 4.172 | DB Queries: 104 | Memory: 11,4/256M | Cache Hits: 9021 | Cache Misses: 1
With P2: Time : 1.334 | DB Queries: 14 | Memory: 14,5/256M | Cache Hits: 3841 | Cache Misses: 0


Page: https://make.wordpress.org/meta/2016/07/11/devhub-weekly-chats-are-restarting/

With O2: Time : 2.430 | DB Queries: 72 | Memory: 9,6/256M | Cache Hits: 3960 | Cache Misses: 1
With P2: Time : 0.960 | DB Queries: 13 | Memory: 13,5/256M | Cache Hits: 2712 | Cache Misses: 0


Most of them are generated by wp_get_object_terms() and it looks like it's the same query executed multiple times.

Change History (4)

#1 follow-up: @dd32
3 years ago

Those database queries are fast so it shouldn't be causing such an issue, based on the significant number of cache hits it's probably doing a lot more to generate the page..

Related for caching of wp_get_object_terms(): #core29942 and #core37198

#2 @ocean90
3 years ago

  • Priority changed from normal to high
  • Summary changed from O2: Reduce number of uncached queries to Improve performance of new O2 sites

Added a little plugin so you can append ?p2=1 to switch to P2 for testing. In the footer you'll see a HTML comment with the data:

  • https://make.wordpress.org/meta/: Time : 4.400 | DB Queries: 131 | Memory: 43,2/256M | Cache Hits: 26317 | Cache Misses: 0
  • https://make.wordpress.org/meta/?p2=1: Time : 2.063 | DB Queries: 11 | Memory: 36,0/256M | Cache Hits: 26432 | Cache Misses: 0

#3 in reply to: ↑ 1 @ocean90
3 years ago

Replying to dd32:

Those database queries are fast so it shouldn't be causing such an issue, based on the significant number of cache hits it's probably doing a lot more to generate the page..

I gave this a try and added some caching to term calls. The number of queries is lower but the overall execution time is more or less the same.

Page: https://make.wordpress.org/meta/2016/06/08/plugin-directory-v3-chat-summary-61/

No patch: Time : 8.861 | DB Queries: 88 | Memory: 21,6/256M | Cache Hits: 9826 | Cache Misses: 0
With patch: Time : 6.905 | DB Queries: 27 | Memory: 21,4/256M | Cache Hits: 9717 | Cache Misses: 0

Page: https://make.wordpress.org/meta/2016/07/11/devhub-weekly-chats-are-restarting/

No patch: Time : 4.324 | DB Queries: 64 | Memory: 20,2/256M | Cache Hits: 5799 | Cache Misses: 0
With patch: Time : 3.447 | DB Queries: 24 | Memory: 20,2/256M | Cache Hits: 5690 | Cache Misses: 0

#4 @pento
3 years ago

  • Resolution set to fixed
  • Status changed from new to closed

After a bunch of work last week, and the addition of [wp38677], here's what https://make.wordpress.org/meta/ looks like:

o2: Time : 1.406 | DB Queries: 13 | Memory: 22,2/256M | Cache Hits: 11316 | Cache Misses: 0
P2: Time : 1.269 | DB Queries: 18 | Memory: 26,4/256M | Cache Hits: 12582 | Cache Misses: 0

o2 could still do with some optimisations, but this looks good enough for our purposes.

Note: See TracTickets for help on using tickets.