Repository navigation
perf: avoid locking cached location expression prototypes - #408
Open
marius-bughiu wants to merge 1 commit into
Open
marius-bughiu wants to merge 1 commit into
marius-bughiu wants to merge 1 commit into
Conversation
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.
Creating location-access activities takes the same process-wide lock even after their type prototype has been cached. Use a concurrent lookup for cache hits, retaining the existing lock and double check for first creation. Every call still creates a fresh activity with its own location reference; failures are retried.
Stack 1/4; base branch
develop. Cumulative results start at public CoreWF commit65caba7c7fc7d141e847775b00f2c9558e8daa59. None of these optimizations relies on duplicate expression text.Measured on six synthetic authored cases with scenario-local variables and mostly unique expressions, with execution templates assigned versus removed. All validation and analyzer rules are enabled. Each of the five source-built CoreWF states ran twice per variant in forward/reverse order, serially on the same machine and compiler host. Every run deleted the isolated project
.localfirst. The actual loaded CoreWF image hashes, input inventories, diagnostics and output coverage were verified.Adjacent change (preceding stack state → this state; medians of two runs):
Whole-process observations behind the adjacent medians: With templates: before [28 s, 27 s], after [25 s, 23 s]. Without templates: before [26 s, 34 s], after [23 s, 24 s].
Cumulative change (original CoreWF state → this state; same cohort):
Validation: 10 new behavior cases passed on the original and changed implementation, including concurrent first use, independent activity/location identity, and uncached failures. The 57 existing expression, validation and compiled-location serialization cases also passed. Release owner builds used SDK 8.0.426 and net6.0-windows; the compiler host used .NET 10.0.11. The complete CoreWF test suite was not run. Build copies disabled the repository's package-generation/global-cache-cleanup postbuild actions; no such project changes are included in this PR.
These are descriptive six-case diagnostics, not a 1,000-case throughput result or a statistical confidence claim. Host load, GC and run order can affect elapsed time; increases are retained in the tables. Managed allocation is not retained heap size. Nested phases overlap and must not be summed. Deltas use unrounded values; displayed values are rounded independently. Matching compiler output coverage does not establish arbitrary workflow execution or persistence equivalence.
Note
This change and description were prepared with AI assistance; the measurements and test results above were collected locally.