Repository navigation
perf(check): flow access and entity-access calls read a flow without decoding it - #2194
Merged
Merged
Conversation
…decoding it Two whole-script checks run once per `check`, and each read every microflow of the project in full. CheckFlowAccess listed every microflow and nanoflow, decoding and converting each flow's body, for its name, Excluded flag and allowed module roles. CheckEntityAccessCalls unmarshalled every microflow and rule for the name, two flags and the call activities, including the flows that hold no call. A check of five statements cost 2 s on a 5,373-unit project whatever the script held, and had since v0.28.0 (mendixlabs#1842). Backend.ListFlowAccess reads the three values from each stored flow's top level, over the units ListMicroflows and ListNanoflows cover; a backend without it is asked for the listings as before. storedEAFlow reads the name and flags the same way and decodes a document only when its bytes hold a call type's name, which a document with a call always does. Both are compared with what they replace: the listing on the fixture's 31 flows after a script gives one roles and excludes another, the reader on every stored microflow and rule and on bytes that are not a document. At 5,373 units, best of three, warm: check of 5 updates 1.98 s -> 0.91 s, of 200 updates 3.85 s -> 2.83 s. Output identical. Refs #2160 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82u4HRCKfX2BBvhgsNm
Both sides added a changelog entry at the same place; both are kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82u4HRCKfX2BBvhgsNm
Both sides added a changelog entry at the same place; both are kept. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82u4HRCKfX2BBvhgsNm
ako
marked this pull request as ready for review
November 12, 2026 23:46
The changelog conflicted for the third time with an entry added at the same place. Main's entry is kept where it is and this branch's entry moves below the other entries of this series, so the next entry added at the top of the list no longer touches it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011oK82u4HRCKfX2BBvhgsNm
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.
Refs #2160 and #2188 (mirror of mendixlabs#1842): the per-run cost of
check.What was slow
Rerunning the reporter's experiment on v0.28.0, v0.31.0 and main (numbers on #2188) showed that
execof an update is now nearly flat in project size, butcheckhas a cost per run that none of the three versions had reduced: about 2 s on a 5,373-unit project for a script of five statements, with a warm file cache.Two whole-script checks run once per
check, and each read every microflow of the project in full:CheckFlowAccessExcluded, allowed module rolesListMicroflows/ListNanoflows: every flow's body decoded and convertedCheckEntityAccessCalls(MDL-SEC22)Excluded,ApplyEntityAccess, the call activitiesbson.D, including the flows that hold no callThe change
Backend.ListFlowAccessreads the three values from each stored flow's top level, over the unitsListMicroflowsandListNanoflowscover and in their order.loadStoredFlowsuses it when the backend has it and the decoded listings otherwise, which is what mock backends serve.storedEAFlowreads the name and flags the same way and decodes a document only when its bytes containMicroflows$MicroflowCallorMicroflows$RuleCall. A$Typeis stored as its name, so a document with a call always contains one.storedEAFlowDecoded, which the test compares against.Evidence
TestListFlowAccess_ListsWhatTheFlowListingsListon PedApp, after a script gives one microflow roles and excludes another. 18 microflows and 13 nanoflows, 22 with roles, 1 excluded; identical, in order. It fails if the fixture holds no flow with roles or none excluded.TestStoredEAFlow_ReadsWhatDecodingTheDocumentReadon every stored microflow and rule of the fixture, with and without calls, and on bytes that are not a document. Only the document with a call is decoded.check --format jsonoutput for scripts of 5, 100 and 200 updates.checkat 5,373 unitsThe first three rows are best of three with a warm file cache; the last is a single run.
Not done
checkafter the project was copied took about 4 s; this does not change that.loadStoredUsesstill unmarshals every page, snippet and navigation document to collect flow references. It was 0.03 s here because the test project has few pages; a page-heavy project will show it.Generated by Claude Code