Repository navigation
Conversation
chrome?(">= 100"), mac?, platform.name on a Mac and every other version check built a Gem::Requirement from its string and, on each new browser, a version from the user agent's. Both are now kept in Cache, bounded like the rest and built outside its lock; a version longer than 32 bytes, or not a String, is still built each time and never reaches RubyGems' own caches, and each object still keeps the last version it used when the cache is off.
Assisted-by: Claude Opus 5.5 [Claude Code]
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs a review before merging: opened without a final independent review. Three review rounds found concurrency bugs in this area; the fixes for the last round were not reviewed. Auto-merge is off on purpose.
Every version check (
chrome?(">= 100"),mac?,platform.nameon a Mac) built aGem::Requirementfrom its string and a version from the browser's: 18 objects per call. Both are now kept inCache, bounded like the rest and built outside its lock.chrome?(">= 100")18 to 5 objects;platform.nameon a Mac 12 to 0; a Mac Safari request asking four versions 8.7 to 3.6 µs.cache_size = 0each object keeps the last version it used, as before.Proof
script/corpus_snapshot.rbbyte-identical to main's; cache on and off give the same answers;rake testandrubocoppass.