Uh oh!
There was an error while loading. Please reload this page.
JIT: Don't allocate string literals inside potential BBJ_THROW candidates - #50112
Conversation
EgorBo
commented
Mar 23, 2021
@dotnet/jit-contrib PTAL |
AndyAyersMS
commented
Mar 23, 2021
Is there a pattern to the methods in this assembly that we might want to reconsider? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5af58ea to
e9ed5baCompare@BruceForstall you're right, I've changed the logic to just scan a top-level node of the current statement in @AndyAyersMS from my understanding, |
BruceForstall
commented
Mar 25, 2021
I believe you're correct. However, have you tried crossgen/crossgen2 libraries SuperPMI asm diffs, or using "jit-diff" without "--pmi", to see if that's the case? |
EgorBo
commented
Mar 26, 2021
yeah with crossgen it's 20x smaller: |
Together with #48589, this PR addresses #48573 (comment)
Example:
Codegen diff for
Main: https://www.diffchecker.com/tZAYRdBYAs you can see,
nameof(args)literal is not allocated on heap during JIT compilation, a lazy-allocate helper is emitted instead.jit-diff (
jit-utils -f --pmi):Quite a size regression (for obvious reasons) but each regression is basically a saved GC allocation.
~ +10 bytes of machine code per each literal (in the cold sections)
PS: 67% of the regression is in
System.Collections.Immutable.dasm