Skip to content

Fix saving tags performance #24667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged

Fix saving tags performance #24667

merged 1 commit into from
Jul 14, 2025

Conversation

crazytonyli
Copy link
Contributor

Description

To reproduce the issue:

  1. Create a self hosted sites, and add 4000 tags.
  2. Use Xcode to launch the Jetpack app, "Enter you existing site address".
  3. Go to a post -> Post Settings -> Tags.

From Xcode, you can see the app's CPU usage jumps to 200% and can last for 10 seconds or more.

Testing instructions

@crazytonyli crazytonyli added this to the 26.1 milestone Jul 11, 2025
@crazytonyli crazytonyli requested a review from kean July 11, 2025 03:11
Copy link

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number28173
VersionPR #24667
Bundle IDorg.wordpress.alpha
Commit579216c
Installation URL0vuso9nuidlg0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number28173
VersionPR #24667
Bundle IDcom.jetpack.alpha
Commit579216c
Installation URL6eg70mbuf4re0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@kean kean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! So, instead of per-tag queries, it now performs as single fetch request.

Nit: It would've been nice to implement this in Swift and cover with a unit test.

@crazytonyli
Copy link
Contributor Author

I'll keep the PR as it is for now, since the PostTagService will probably be used very rarely once the "Post Settings -> Add tags" stops using it (see #24670).

@crazytonyli crazytonyli added this pull request to the merge queue Jul 14, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 14, 2025
@crazytonyli crazytonyli added this pull request to the merge queue Jul 14, 2025
Merged via the queue into trunk with commit b97317d Jul 14, 2025
32 of 34 checks passed
@crazytonyli crazytonyli deleted the bugfix/tags-poor-performance branch July 14, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants