Make WordPress Core

Opened 2 years ago

Last modified 2 years 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.


2 years 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
2 years ago

  • Keywords reporter-feedback added

Thanks for the PR @wladwm! Amd welcome.

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

Cheers

Version 0, edited 2 years ago by johnbillion (next)

#3 @wladwm
2 years 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.