Make WordPress Core

Opened 19 months ago

Last modified 19 months ago

#54479 new enhancement

Set_blog_id performance

Reported by: wladwm's profile wladwm Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.9
Component: General Keywords: has-patch reporter-feedback
Focuses: multisite, performance Cc:

Description

On multisite many plugins switches blog (wbdb->set_blog_id) many times (few thousands).
There is a performance impact in wpdb->tables method.
Simple caching reduces overall execution time.

Change History (3)

This ticket was mentioned in PR #1925 on WordPress/wordpress-develop by wladwm.


19 months ago
#1

  • Keywords has-patch added

https://core.trac.wordpress.org/ticket/54479#ticket

Add tables names caching for multisite in wpdb->set_blog_id to improved performance with blogs switching.

Trac ticket: https://core.trac.wordpress.org/ticket/54479

#2 @johnbillion
19 months ago

  • Keywords reporter-feedback added

Thanks for the PR @wladwm! And welcome.

Could you share some before and after performance numbers please? Would be good to see what impact this has.

Cheers

Last edited 19 months ago by johnbillion (previous) (diff)

#3 @wladwm
19 months ago

Hi johnbillion.

On some pages delay for example was reduced from 5.92sec to 5.17sec.
But with some plugin I even cant open some pages w/o patch - cloudfare timeout occurs.
I did some debugging yesterday when discovered this issue with massive blog switching:
https://ibb.co/B6pd1W4

Note: See TracTickets for help on using tickets.