Skip to content

Memoized result within request#1033

Merged
selul merged 2 commits intodevelopmentfrom
bugfix/1031
Mar 24, 2026
Merged

Memoized result within request#1033
selul merged 2 commits intodevelopmentfrom
bugfix/1031

Conversation

@girishpanchal30
Copy link
Contributor

All Submissions:

Changes proposed in this Pull Request:

Improved performance of get_site_settings by storing the result in a static variable and reusing it during the same request.

Closes #1031

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@girishpanchal30 girishpanchal30 requested a review from Copilot March 19, 2026 13:49
@pirate-bot
Copy link
Collaborator

pirate-bot commented Mar 19, 2026

Plugin build for 5e3a659 is ready 🛎️!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves runtime performance by memoizing Optml_Settings::get_site_settings() so repeated calls within the same request reuse a previously built settings array instead of rebuilding it each time.

Changes:

  • Add request-local memoization to Optml_Settings::get_site_settings() using a static cache.
  • Reuse the cached settings array for subsequent calls in the same request.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@selul selul merged commit 239d537 into development Mar 24, 2026
12 checks passed
@selul selul deleted the bugfix/1031 branch March 24, 2026 12:10
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.

Performance: get_site_settings() called per-URL without caching (100K+ redundant calls)

5 participants