-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Closed
Copy link
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issuePerformance related issue
Milestone
Description
#1378 introduced an optimization to fold "const str".Length into a const int. It probably makes sense to extend it to also support static readonly string fields, e.g:
Prototype: master...EgorBo:static-readonly-string-fields-opts
(it extends the existing jit-vm API getStringLiteral to accept a field reference).
jit-diff (--pmi --cctors) is not as exciting as I hoped:
(Lower is better)
Total bytes of diff: -242 (-0.00% of base)
diff is an improvement.
Top file improvements (bytes):
-143 : System.Diagnostics.DiagnosticSource.dasm (-0.18% of base)
-83 : Microsoft.CodeAnalysis.dasm (-0.00% of base)
-16 : xunit.execution.dotnet.dasm (-0.01% of base)
3 total files with Code Size differences (3 improved, 0 regressed), 264 unchanged.
Top method improvements (bytes):
-143 (-29.12% of base) : System.Diagnostics.DiagnosticSource.dasm - Activity:GenerateRootId():String
-71 (-18.68% of base) : Microsoft.CodeAnalysis.dasm - Reader:Read(ref,int,int):int:this
-16 (-5.42% of base) : xunit.execution.dotnet.dasm - SerializationHelper:GetType(String,String):Type
-12 (-26.67% of base) : Microsoft.CodeAnalysis.dasm - Reader:SetText(String):this
Top method improvements (percentages):
-143 (-29.12% of base) : System.Diagnostics.DiagnosticSource.dasm - Activity:GenerateRootId():String
-12 (-26.67% of base) : Microsoft.CodeAnalysis.dasm - Reader:SetText(String):this
-71 (-18.68% of base) : Microsoft.CodeAnalysis.dasm - Reader:Read(ref,int,int):int:this
-16 (-5.42% of base) : xunit.execution.dotnet.dasm - SerializationHelper:GetType(String,String):Type
4 total methods with Code Size differences (4 improved, 0 regressed), 258661 unchanged.
Completed analysis in 18.54s
so feel free to close it if you think it's not worth the effort.
category:cq
theme:basic-cq
skill-level:beginner
cost:small
am11 and gfoidl
Metadata
Metadata
Assignees
Labels
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMICLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMItenet-performancePerformance related issuePerformance related issue
