Skip to content

Feat: Significant performance improvements across all mass taggers#718

Closed
Servbot91 wants to merge 1 commit into
stashapp:mainfrom
Servbot91:performance/all-mass-taggers-improvement
Closed

Feat: Significant performance improvements across all mass taggers#718
Servbot91 wants to merge 1 commit into
stashapp:mainfrom
Servbot91:performance/all-mass-taggers-improvement

Conversation

@Servbot91
Copy link
Copy Markdown
Contributor

@Servbot91 Servbot91 commented May 29, 2026

Dev Notes

These changes provide on average about a 95% performance improvement to all 4 mass taggers. I have tested these individually and running concurrently without issue. Mass tagging galleries, images, and scenes has dramatically increased. The previous logic did not properly use the schema which caused the DB to get absolutely blasted with "slow query" messages in debug.

If running these plugins concurrently, they would ping pong off each other causing loops further running away with your DB's performance. You also had the issue of the scripts reiterating over files they should be ignoring which also contributed to unnecessary load. If your database size is significant or you have large galleries this could bring your DB to its knees and would basically require you to run these tasks over night.

For using the 'Tag all galleries from images' feature, I have gone from over 2 days ETA to 40 minutes across 2.5 million images.
'Tag Images with performer' tags of 5k+ performers has been reduced to less than 30 minutes down from 7 hours.
'Tag all images from galleries' (80k + galleries) is down from 14 hours to 40 minutes.
'Tag all scenes' (20k+) went from 4 hours to 20 minutes.

These changes maintain core logic while also improving performance. User performance will vary, but at the very least the scripts are running significantly more optimal than they were before.

-Sakoto


These images demonstrate that no more slow queries display under load with all taggers running in tandem and a mass tagger running.

Screenshot 2026-05-28 222025 Screenshot 2026-05-28 221850 Screenshot 2026-05-28 205124

Changes

  • Galleries to images now tags studios down to images
  • All mass tagging tags are significantly faster (95% performance gain)
  • Taggers no longer loop and piggy back off each other when used at the same time causing a performance runaway
  • Database no longer crawls when performing a mass tag allowing users to continue to use their DB (and even tag individually) without destroying DB performance
  • Taggers better utilizing stash schema
  • Fixed infinite loop bug with pagination
  • Taggers ignore entities that do not need updating
  • More informative log messaging
  • Better Debug info
  • Better hook management
  • Loop safety checks

@discourse-stashapp
Copy link
Copy Markdown

This pull request has been mentioned on Stash Forum. There might be relevant details there:

https://discourse.stashapp.cc/t/tag-images-from-galleries/6024/5

@DogmaDragon
Copy link
Copy Markdown
Contributor

Could you split this into separate PRs? It's updating 3 plugins from 3 different authors and adding a new one on top of that.

@Servbot91
Copy link
Copy Markdown
Contributor Author

Servbot91 commented May 29, 2026 via email

@DogmaDragon
Copy link
Copy Markdown
Contributor

  1. It makes review process harder.
  2. If there are needed changes, it will block the whole PR even if only one plugin is affected.
  3. We give original authors a chance to review PRs targetting their plugins, which will delay the merge of whole PR instead of only affected plugin,
  4. I prefer clear and conside PRs for adding new plugins as it makes tracking commit history a lot easier down the line and to avoid license issue with https://github.com/Servbot91/StashAPP-TagImagesFromGalleries/tree/main/plugins/tagImagesFromGalleries version which doesn't have any license.

@Servbot91
Copy link
Copy Markdown
Contributor Author

Servbot91 commented May 30, 2026 via email

@DogmaDragon
Copy link
Copy Markdown
Contributor

The bureaucracy involved with submitting changes to this repo seems to continuously create more work than its worth for me.

We don't see having license complience and giving original authors an opportunity to review changes before they are pushed as bureaucracy, but it's fair if that's too much for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants