Skip to content

Cache fom literal string extraction - #1730

Merged
douglasjacobsen merged 1 commit into
GoogleCloudPlatform:developfrom
linsword13:fom-opt
Aug 21, 2026
Merged

Cache fom literal string extraction#1730
douglasjacobsen merged 1 commit into
GoogleCloudPlatform:developfrom
linsword13:fom-opt

Conversation

@linsword13

Copy link
Copy Markdown
Member

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes performance in lib/ramble/ramble/util/foms.py by refactoring FomType methods to use static lookup dictionaries and introducing an LRU cache for regex literal extraction. A review comment suggests returning a copy of the dictionary in to_dict to prevent callers from accidentally modifying the global cache.

Comment thread lib/ramble/ramble/util/foms.py
@ramble-pr-bot

ramble-pr-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

Ramble Performance Test Metrics

Results produced with commit: 2f597ec

Test Name Outcome Duration (s) Most Recent Run (s) Last 5 Avg (s)
test_analyze_large_file passed 2.0787 2.0792 (68681d4) 2.0969
test_large_template_expansion passed 1.2024 1.1981 (68681d4) 1.5081
test_many_experiments passed 25.3015 24.4462 (68681d4) 25.0302
test_many_objects_defaults passed 12.7982 13.1446 (68681d4) 13.9296
test_matrix_filter_perf passed 1.1453 1.0867 (68681d4) 1.1523

@linsword13
linsword13 marked this pull request as draft August 19, 2026 17:43
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.01%. Comparing base (68681d4) to head (2f597ec).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
lib/ramble/ramble/util/foms.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1730      +/-   ##
===========================================
- Coverage    94.01%   94.01%   -0.01%     
===========================================
  Files          367      367              
  Lines        36886    36893       +7     
===========================================
+ Hits         34679    34684       +5     
- Misses        2207     2209       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@linsword13
linsword13 marked this pull request as ready for review August 20, 2026 16:53
@douglasjacobsen
douglasjacobsen merged commit 55fe21c into GoogleCloudPlatform:develop Aug 21, 2026
30 checks passed
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.

2 participants