Conversation
…d lower memory - Cache key did not include caseInsensitive and had no separator between ic and oc, so MAP -cis and plain MAP of the same file shared one cached map, and ic=1,oc=[23] collided with ic=12,oc=[3]. Use a delimited key with all parameters. - Concurrent pipelines of a request (e.g. pgor partitions) sharing the session cache each built their own copy of the same map. Load under a per request and key lock, re-checking the cache after acquiring it. - Share repeated value strings while loading a map (bounded pool), map value columns repeat heavily. - MULTIMAP: move entries into a presized output map instead of copying, so both maps are not fully held at the same time. Measured heap retained after GC (1M line files, values from 50 distinct strings): single map 160.8 MB -> 98.4 MB, multimap 90.4 MB -> 28.0 MB, multimap peak during load 350.1 MB -> 305.9 MB. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
Changes to
MapAndListUtilities(the loaders behind MAP, MULTIMAP and INSET):"map"+filename+ic+oc.mkString(",")+asSet(and the same withoutasSetfor multimap).caseInsensitive, soMAP -cisand a plainMAPof the same file in one request shared one cached map, and one of them returned wrong results.icandoc, soic=1, oc=[23]andic=12, oc=[3]collided.ListBuffermap and theArraymap are never both fully held.Measurements
Heap retained after GC. Synthetic 1M-line files with values drawn from 50 distinct strings.
Tests
UTestMapAndListUtilities, 6 tests. All 6 fail on main and pass with this change:-cisvs plain map and multimap cachingUTestGorMapMultimap,UTestMapLookup,UTestMultiMapLookup,UTestGorPipeSession,UTestDAGMapAnalysis(42 tests, including the new ones).:model:testpasses: 1,548 tests, 17 skipped.🤖 Generated with Claude Code