EACL cache: consistency-aware recursive, lookup, and count acceleration - #80
Open
theronic wants to merge 8 commits into
Open
EACL cache: consistency-aware recursive, lookup, and count acceleration#80theronic wants to merge 8 commits into
theronic wants to merge 8 commits into
Conversation
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
Follow-up to #79 that removes repeated-prefix recursive traversal and adds bounded authorization caching without adding permanent consumer storage.
basis-t, so unrelated application transactions do not make an identical walk cold.can?, lookup, and count results, plus cache-resident exact snapshots. Keys and result identities use internal EIDs.Adversarial review fixes
The performance review found and fixed several issues that were hidden by the original single-size benchmark:
t.can?keys use compact internal scalar identities.Coherence and consistency
Relationship helpers hold the configured coordinator barrier through transaction completion and publish the exact committed Datomic
tonly for relation definitions whose tuples changed. Unrelated application transactions, no-op writes, and writes outside a permission's dependency set preserve eligible entries.Every cache-enabled client has a local coordinator for its own cursor proofs. Cross-client live memoization remains opt-in and requires one explicitly shared coordinator for every participating reader and relationship writer. Direct transactions of EACL-owned relationship or schema data are outside the coherence contract and are not polled.
fully-consistentuses the DB visible to the local Peer without forcing zero-argumentd/sync.at-least-as-freshmay perform only the targeted wait requested by its token.at-exact-snapshotis cache-resident and never invokesd/as-of.Performance
The revised benchmark measures actual v7.3 (
2ccc6c4) in a separate JVM, cache-disabled replay, continuation advancement, completed-page hits, deterministic graph work, five graph sizes, and five page sizes.At 4,000 recursive results with page size 25:
Continuations perform 77.46× less graph work, make the first walk 34.1× faster than v7.3, and make a repeated walk 67.0× faster. The continuation path stays below
1.04Nderived grants; replay grows approximately withN²/page-size.On a 2,000-result graph:
The remaining recursive cost is linear cold traversal plus work proportional to returned results and public page count. Profiling 1,000 results over 40 pages measured about 5.9 ms in the continuation engine, 0.5 ms in cache I/O, and 3.7 ms in cursor encryption/decryption; response coercion overlaps most cursor encryption.
The same warmed heavy run measured:
can?: 12.00 µs default, 3.88 µs completed live hit;Verification
All Clojure tests were run through nREPL.
Release
Implemented as the v7.4 candidate while remaining suitable for consideration as a v7.3 patch because v7.3 is recent. This PR remains intentionally stacked on #79.