-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue
Milestone
Description
Lots of times for readability I use "constant_string".Length instead of 15 in my code. For example:
string TextAfterFoo(string s) =>
s.Substring(s.IndexOf("Foo") + "Foo".Length); // a lot more readable than `3`It would be nice if RyuJIT could optimize this as a JIT-time constant, so a string wouldn't have to actually be loaded and called Length on.
category:cq
theme:basic-cq
skill-level:intermediate
cost:medium
HellBrick, KrzysFR, GSPP, omariom, Unknown6656 and 14 moresachinjoseph
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 SuperPMIenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issuePerformance related issue