Skip to content

Conversation

aatanasov-cloudinary
Copy link
Collaborator

Improve the sanitize_slug method for better performance.

Approach

  • sanitize_slug is used when needed only.

QA notes

  • Ensure images are delivered from Cloudinary and the admin settings work.

@yonran
Copy link

yonran commented Oct 7, 2025

Thank you! I tested your branch and found that it had an equivalent performance improvement to my #1091. This PR reduces median request time (compared to master) by about 123ms (tracing disabled) and with flamegraph trace enabled (xdebug.mode=trace, xdebug.trace_format=3, xdebug.use_compression=true, --cookie XDEBUG_TRACE=1), it reduces Cloudinary\Plugin->setup time from 1.5s to 221ms (saves 1.3s).

master: setup takes 1.5s with trace enabled:
Screenshot 2025-10-07 at 1 56 46 PM

This PR #1101: setup takes 220ms with trace enabled:
Screenshot 2025-10-07 at 1 56 57 PM

My previous PR #1091: setup takes 205ms with trace enabled (negligible difference from this PR)
Screenshot 2025-10-07 at 1 57 05 PM

@aatanasovdev
Copy link
Contributor

Hi @yonran , thanks for testing this PR and confirming that the changes perform well.

I'm sending this PR for internal code review, and those changes will be released in the next plugin version.

Copy link
Collaborator

@gabrielcld2 gabrielcld2 left a comment

Choose a reason for hiding this comment

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

👍 Everything works as before @aatanasov-cloudinary. thanks for the changes

@aatanasov-cloudinary aatanasov-cloudinary merged commit bcbe322 into develop Oct 9, 2025
5 checks passed
@aatanasov-cloudinary aatanasov-cloudinary mentioned this pull request Oct 9, 2025
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.

4 participants