Performance team meeting summary 24 May 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Announcements

@shetheliving

  • Reminder: No meeting next week, 31 May, as many folks will be traveling/prepping to travel to WCEU
  • We’ll be well-represented at WCEU with three talks and a large section of the WP community booth; see this doc for details and info on contributing
  • Bethany will be offline 1-15 June and @clarkeemily will run the 6 and 13 June meetings

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

  • @adamsilverstein: Finishing up some WebP issues, primarily around handling edit and restore actions correctly. Several multi-mime type/WebP features in the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party were not in the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing. yet, so working on follow-up core patches to add them. For example, this patch adds the ability to always use the smaller image size for image references. Also did some research this week on a polyfill to enable WebP support for older browsers and developed a script to use a capability check before dynamically loading the library to add support. We also have sent out a survey to hosting providers about image storage to get more data about the impact of WebP on storage.
  • @pbearne @spacedmonkey: Add low quality image placeholders #19 should be ready to merge (example)
    • @adamsilverstein will take another look and @shetheliving will make sure @flixos90 does when he’s back online
    • @adamsilverstein: Since this is a proposed core patch, is there already a matching TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker.?
    • @pbearne @spacedmonkey: No; that is a wider conversation about porting over functionality to core and when/how this should happen (and how/if we remove it from the plugin)
    • @shetheliving: We’ll add this to the 6 June meeting agenda cc @clarkeemily

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

Feedback requested

Site Health

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.
  • @furi3r: Add Site Health test for full page caching (advanced cache) #220 was moved to 1.2.0 is just about ready and waiting for testing. Need to determine how/if we want to port any existing Site Health modules to core.

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or ping in Slack
  • No updates

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath @sergiomdgomes

GitHub project

  • No updates

Feedback requested

Infrastructure

@flixos90

GitHub project

  • @flixos90 offline
  • @shetheliving: If you haven’t already, review the module proposal workflow and leave any feedback on the PR. Next step would be to merge this and create a new GH issue template for module proposals.
  • @shetheliving: Reminder that next release will be 1.2.0 on Monday, June 20, so we should target merge for anything for that release by about June 15.

Feedback requested

Open floor

  • @spacedmonkey: Is there anything we want to specifically focus on for 6.1?
    • @olliejones: Maybe more/better large-site performance increases? WHERE wp_usermeta.meta_key = 'wp_capabilities' AND meta_value LIKE '%editor%' is the performance botch; ticket here. Probably needs another because this one mentions GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/, but problem also exists in Users, Posts, and Pages.
    • @clorith: Query improvements for 6.0 were nice and don’t look large, but it all adds up quickly, so would love to see more of a review of queries and how they can be improved. May be some old ones from years back where smarter queries now exist.
    • @spacedmonkey: Would focus on SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17 #47280
    • @pbearne: Have been digging into the rest and FSE queries are seeing a lot of low-hanging fruit that could be improved

Help wanted

#core-js, #core-media, #performance, #performance-chat, #summary

#hosting-community

Performance Chat Agenda: 24 May 2022

Here is the agenda for this week’s performance team meeting scheduled for May 24, 2022, at 15:00 UTC.


This meeting happens in the #performance channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Performance team meeting summary 17 May 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Announcements

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

Feedback requested

Site Health

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.
  • @furi3r: Add Site Health test for full page caching (advanced cache) #220 was moved to 1.2.0 is just about ready and waiting for testing

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or ping in Slack
  • No updates

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath @sergiomdgomes

GitHub project

  • No updates

Feedback requested

Infrastructure

@flixos90

GitHub project

  • @shetheliving: Review the module proposal workflow and leave any feedback on the PR
    • @flixos90: We’ve been working on this to have a long-term plan for each module; want to avoid a module going into the plugin and growing stale without any iterations or next steps
    • @jeffpaul: I’ll review with an eye from the core perspective
    • @flixos90: Another benefit of this documentation is that it includes a high-level overview of how to propose a feature project for core, which isn’t really documented right now; this could be a good starting point for the future
  • @olliejones: Might be cool to have a stub performance-lab module for modification by would-be contributors
    • @flixos90: That’s a great idea, though there would be little to start with since a module can be pretty much anything. The best place to start right now is with the writing a module doc, though that’s more about the technical starting point and the new proposal doc is more about overall workflow.
  • @flixos90: Released v1.1.0 yesterday. Next release will be 1.2.0 on Monday, June 20, so we should target merge for anything for that release by about June 15.

Feedback requested

Open floor

  • @olliejones: Following up on the large site/many users work: https://core.trac.wordpress.org/ticket/55749
    • Have a new plugin to address the issues outlined there
    • Might be a candidate for a Performance Lab module
    • These issues are mostly fixable with filters and actions, but not completely
    • @adamsilverstein: Looks like a core side issue; the TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. describes hte issue better. Is the issue specific to the REST endpoint or more generally about how the user query is constructed?
    • @olliejones: It’s actually central to WP_User_Query and WP_Meta_Query, but at the same time the REST endpoint’s set of parameters doesn’t allow for avoiding the query-pagination overhead

Help wanted

#core-js, #core-media, #performance, #performance-chat, #summary

Performance Chat Agenda: 17 May 2022

Here is the agenda for this week’s performance team meeting scheduled for May 17, 2022, at 15:00 UTC.


This meeting happens in the #performance channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Performance team meeting summary 10 May 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

  • @adamsilverstein: Refreshed the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. WebP patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing. against trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision. and started separate follow-up PRs for new featured added to the pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party since then.
  • @shetheliving: Getting pretty close to wrapping up initial proposals for API to facilitate more accurate sizes #140 and Regenerate existing images #24; next steps will be more detailed design docs and core feature proposals. Research continues on Research: Impact of additional WebP images on upload #289 and Research: WebP compatibility #290 and we’ll draft a follow-up post about our findings and next steps.
  • @adamsilverstein: For Research: Impact of additional WebP images on upload #289, working on a survey for hosting providers to gather some field data about file count and size limitations
  • @eugenemanuilov: If there’s someone who has Outlook and Windows, please test if WebP is supported for Research: WebP compatibility #290
    • @codekraft: Looks like it’s supported in the most recent version
  • @adamsilverstein: Found this summary of WebP support in OG tags; looks like sites should stick with JPEG for OG tags

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

Feedback requested

Site Health

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.
  • @furi3r: Add Site Health test for full page caching (advanced cache) #220 is almost ready to be merged

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or ping in Slack
  • No updates

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath @sergiomdgomes

GitHub project

  • No updates

Feedback requested

Infrastructure

@flixos90

GitHub project

Feedback requested

Open floor

Help wanted

#core-js, #core-media, #performance, #performance-chat, #summary

Performance Chat Agenda: 10 May 2022

Here is the agenda for this week’s performance team meeting scheduled for May 10, 2022, at 15:00 UTC.


This meeting happens in the #performance channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Performance team meeting summary 3 May 2022

Meeting agenda here and the full chat log is available beginning here on Slack.

Focus group updates

Images

@adamsilverstein @mikeschroder

GitHub project

Feedback requested

Object Cache

@tillkruess @spacedmonkey

GitHub project

Feedback requested

Site Health

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or pingPing The act of sending a very small amount of data to an end point. Ping is used in computer science to illicit a response from a target server to test it’s connection. Ping is also a term used by Slack users to @ someone or send them a direct message (DM). Users might say something along the lines of “Ping me when the meeting starts.” in SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/.
  • @furi3r: PR for Site Health test for full page caching is still open; would love another review to get into the next release@flixos90 will take another look
  • @flixos90: Is there any update on the work to refine the two existing experimental Site Health modules to make them non-experimental and eventually merge to coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.?
    • @furi3r: We should go over them again and take another look
  • @spacedmonkey: Should we use next week’s meeting to decide what we want to get merged into 6.1
    • @flixos90: Great idea, as well as looking owners for whatever we decide on

Feedback requested

Measurement

N/A

GitHub project

  • We’re seeking 1-2 POCs for this group; if you’re interested, please comment here or ping in Slack
  • No updates

Feedback requested

JavaScriptJavaScript JavaScript or JS is an object-oriented computer programming language commonly used to create interactive effects within web browsers. WordPress makes extensive use of JS for a better user experience. While PHP is executed on the server, JS executes within a user’s browser. https://www.javascript.com/.

@aristath @sergiomdgomes

GitHub project

  • No updates

Feedback requested

Infrastructure

@flixos90

GitHub project

  • @flixos90: Decision has been made to follow WP core’s versioning approach for our pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party based on the vote in Define plugin versioning approach #300, so next release will be 1.1.0.
  • @flixos90: The other decision we need to make is about release cadence in Define plugin release cadence #320.
    • Before 1.0.0, we published every two weeks, which is the minimum but requires some additional maintenance and overhead, so a timeline of four weeks or more is probably better. At the same time, we don’t want to go too long and lose momentum.
    • @adamsilverstein: Monthly feels straightforward to keep track of; longer gets more difficult
    • @pbearne: A 4 week cycle feels right to me
    • @eugenemanuliov: Yes, 4 weeks seems to be most appropriate
    • @jeffpaul: 10up open sourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. team checks what’s releasable on the first day of the month and determines if it requires a major, minor, or no release. If there’s a release, it’s done in a subsequent week that month.
    • @flixos90: Could also do monthly, e.g. third Monday of the month. Will add to the options in the issue.
    • Vote is open here until next Monday

Feedback requested

Open floor

  • @jb510: Research: Impact of additional WebP images on upload #289 focuses on the file system impact of WebP. But when an image is uploaded to a post, there is the time it takes the original to upload, but then the user has to wait while additional image sizes are generated and the progress bar for that action completes. We should then consider the impact of WebP generation has on that already sometimes frustrating delay between generating JPEG only vs JPEG+WebP. Want to make sure this is being considered. I recommend moving this to the background.
    • @jeffpaul: Agreed, that UXUX User experience is quite painful
    • @adamsilverstein: Moving to the background would make sense, as that image generation is slow and can break if you navigate away from the editor. Related Gutenberg issue.
    • @adamsilverstein: Note that the progress bar only shows upload progress, not processing progress
    • @pbearne: Once WP has the image, we should be able to release the editor and do the processing in a new thread
    • @jb510: For scope, consider 1) measuring impact of additional processing/completion time due to WebP and 2) finding a way to move that out of blocking the user from continuing with what they wanted to be doing

Help wanted

#core-js, #core-media, #performance, #performance-chat, #summary

Performance Chat Agenda: 3 May 2022

Here is the agenda for this week’s performance team meeting scheduled for May 3, 2022, at 15:00 UTC.


This meeting happens in the #performance channel. To join the meeting, you’ll need an account on the Making WordPress Slack.

#agenda, #meeting, #performance, #performance-chat

Performance increase for sites with large user counts (now also available on single site)

In WordPress 6.0, websites with more than 10,000 users will see improvements in handling users. Prior to changes in #38741, sites with more than 10,000 users would suffer from slow page loading time in the user and post list screens. 

The user screen was slow because a complex SQL query was run to get the number of users for each role. This sometimes resulted in page timeout or failures to load. On the post edit screen, a dropdown of authors in the quick edit option used to change the post’s author. On large sites, this results in thousands of options rendered on the page, which creates a large amount of markup and causes timeouts and slowdowns. 

Introducing large sites

The idea of a large networknetwork (versus site, blog) in multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site configurations of WordPress has existed since WordPress 3.0. A network is considered large when it has over 10,000 users. When marked as such, any real time calculation of the number of users is skipped and all counts of users are deferred to scheduled (cron) events. 

This idea of a large network has now been ported to single site installs of WordPress. Any site with more than 10,000 users is marked as large. Once this threshold is met, real time counts, such as ones noted above, no longer occur on every page load. This means that when viewing user lists, the count next to each user role will be missing. This massively improves the performance of the page page load and prevents slow database queries causing PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher timeout errors, which in turn helps ensure the user list renders every time on large sites. 

This change includes some new functions:

  • get_user_count
    Now available for both single- and multi-site installations. For sites with over 10,000 users recounting is performed twice a day by a scheduled event. 
  • wp_update_user_counts
    Perform a user count and cache the result in the user_count site option. 
  • wp_is_large_user_count
    Determines whether the site has a large number of users. The default threshold of 10,000 users can be modified using a filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output. of the same name.

Now that the get_user_count is available for both single and multisite, it is strongly recommended not to use the count_users function in your code. This function is not performant and is the root cause of issues noted above. Wherever possible, every instance of count_users in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. has been converted to use get_user_count, which is also recommended action for pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party authors. 

Props to @kkautzman, @milana_cap, and @bph for review and proofreading.

#6-0, #dev-notes, #dev-notes-6-0, #performance

Caching improvements in WordPress 6.0

As part of the release of WordPress 6.0, the new Performance team has been working on several improvements to the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. There are a few new additions to the WordPress Caching APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways..

Batch API methods for Cache Operations (wp_cache_*_multiple)

The function wp_cache_get_multiple() was added in WordPress 5.5. This allowed for multiple cache keys to be collected in just one request. To complete this API, a full CRUDCRUD Create, read, update and delete, the four basic functions of storing data. (More on Wikipedia.) was needed and has been added via the following functions:

  • wp_cache_add_multiple
  • wp_cache_set_multiple
  • wp_cache_delete_multiple

All of these functions accept an array of data to be passed so that multiple cache objects can be created, edited, or deleted in a single cache call.

In WordPress core, these are just wrappers for core functions to allow multiple keys to be passed in one function call, but this would also allow object caching drop-in developers to implement them if their back-end supports it.

Example usage of wp_cache_add_multiple( $data, $group = '', $expire = 0 )

  • $data: Array of key and value pairs to be added.
  • $group: Optional. String. Where the cache contents are grouped. Default ”.
  • $expire: Optional. Int. When to expire the cache in seconds. Default 0 (no expiration).
wp_cache_add_multiple( array( 'foo1' => 'value1', 'foo2' => 'value2' ), 'group1' );

Example usage of wp_cache_delete_multiple( $data, $group = '' )

  • $data: Array of keys to be deleted.
  • $group: Optional. String. Where the cache contents are grouped. Default ”.
wp_cache_delete_multiple( array( 'foo1', 'foo2' ), 'group1' );

Example usage of wp_cache_set_multiple( $data, $group = '', $expire = 0 )

  • $data: Array of key and value pairs to be set.
  • $group: Optional. String. Where the cache contents are grouped. Default ”.
  • $expire: Optional. Int. When to expire the cache in seconds. Default 0 (no expiration).
wp_cache_set_multiple( array( 'foo1' => 'value1', 'foo2' => 'value2' ), 'group1' );

With these additions, some additional core refactoring has been done to utilize these new functions. See more details in TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. #55029.

Allow runtime cache to be flushed (wp_cache_flush_runtime)

As discussed in the Performance issue #81 and Trac #55080, Core needed a way to allow users to flush the runtime (in-memory) cache without flushing the entire persistent cache.

This feature was often requested for instances where long-running processes such as Action Scheduler or WP-CLIWP-CLI WP-CLI is the Command Line Interface for WordPress, used to do administrative and development tasks in a programmatic way. The project page is http://wp-cli.org/ https://make.wordpress.org/cli/ are run.

Example usage of  wp_cache_flush_runtime()

$counter = 0;
foreach ( $posts as $post ) {
	wp_insert_post( $post );
	if ( 100 === $counter ) {
		wp_cache_flush_runtime();
		$counter = 0;
	} 
	$counter++;
}

The above example would reset the runtime cache after 100 posts are inserted into the database.

Thanks to @shetheliving, @milana_cap, @costdev, @webcommsat, and @spacedmonkey for peer review.

#6-0, #cache, #dev-notes, #dev-notes-6-0, #performance