Repository navigation
Use DocumentTransactions.read_shared on read-only HumanReadCut, ReadLedger, and ChannelCatalog paths - #5279
Merged
Conversation
…edger, and ChannelCatalog paths
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
Eliminates per-call
copy.deepcopy()of the 229 KBread_ledger.json(ReadDocument) andchannels.json(CatalogDocument) on read-only observation and bus hot paths by promotingDocumentTransactions._read_sharedtoDocumentTransactions.read_shared()(mirroringRegistryStore.snapshot_with_pair's existingread_shared_copiedpath).Changes
src/agent_comms/storage/locked_store.py: factored_read_withhelper and exposedDocumentTransactions.read_shared()alongsideread().src/agent_comms/messaging/human_read_cut.py:HumanReadCut.documentusesself.ledger.read_shared().src/agent_comms/messaging/read_ledger.py:ReadLedger.cursorandReadLedger.transcript_seenuseself.read_shared().src/agent_comms/messaging/historical_views.py: historical view reads usepresentation.bus.reads.read_shared().src/agent_comms/messaging/message_bus.py&published_bus.py: read-onlyChannelCataloglookups useself._channels.read_shared().src/agent_comms/transport/connector_store.py: migrated_read_shared()->read_shared().Live wall-clock measurements (alternating warm A/B on live
/home/ts/.agent-comms)HumanReadCut(live).document(read_ledger.json, 229 KB):6.3450 ms -> 0.0145 ms(437.6x faster)ChannelCatalog.read()vsread_shared()(channels.json):0.109 ms -> 0.011 ms(10.1x faster)Verification
147 passed(test_read_ledger,test_message_notifications,test_notification_recipient_window,test_recipient_activity_index,test_historical_views,test_connector), exit 0.base=10 -> head=10(0new findings),REL_IMPORTS=0.