Repository navigation
Speed up compile-time stunt generation - #287
Merged
Merged
Conversation
Explicit type arguments no longer force a semantic bind. The call is bound only when its method name is a known generator, same as inferred calls.
Binding every stunt against the user compilation, then formatting and rebinding it for registration, was most of the generator time on Static.
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
NormalizeWhitespace, and rebinding constructors for registration. Metadata bases now bind on a treeless compilation, syntax-only processors skip that compilation update, top-level stunts register from symbols already in hand, and generation plus text emit run in parallel.Select<T>still skip binding when the method name cannot be a generator. That does not change Static, where almost every call isStunt.Of<T>.Static benchmark
src/Acceptance/Static/Static.csproj(6,146 generated stunts from about 7,157Stunt.Of<T>()calls), Release, directcsc /reportanalyzer.DynamicStuntsis the same command withStunts.CompiledProxy.dllremoved.The generator is about 6x faster. The remaining gap versus DynamicStunts is compiling and analyzing those 6,146 generated types, which dynamic mode does not emit. Set
STUNTS_PROFILEto a file path to write a per-phase breakdown; it stays off otherwise.Test plan
StuntGeneratorTests(48) andStuntScaffoldTests.EnsureScaffoldcsc /reportanalyzerexits 0, numbers above