This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Inline String->ReadOnlySpan#16440
Merged
Merged
Conversation
Member
|
cc: @AndyAyersMS |
jkotas
approved these changes
Feb 18, 2018
Member
Author
|
Currently its gets pre-marked as no-inline Marking String:op_Implicit(ref):struct as NOINLINE because of unprofitable inline
Successfully inlined String:GetRawStringData():byref:this (7 IL bytes) (depth 1) [below ALWAYS_INLINE size]
Successfully inlined ReadOnlySpan`1:.ctor(byref,int):this (20 IL bytes) (depth 1) [aggressive inline attribute]
**************** Inline Tree
Inlines into 06000217 String:op_Implicit(ref):struct
[1 IL=0014 TR=000008 06000236] [below ALWAYS_INLINE size] String:GetRawStringData():byref:this
[2 IL=0025 TR=000019 060014E4] [aggressive inline attribute] ReadOnlySpan`1:.ctor(byref,int):thisThen all following occurances [FAILED: noinline per IL/cached result] String:op_Implicit(ref):struct |
stephentoub
approved these changes
Feb 18, 2018
Member
|
Looks like the prejit inline evaluation just missed thinking this was a good candidate: If this method was a constructor instead of a conversion operator it would have gotten an additional benefit boost and would not have been preemptively classified as no inline. So for consistency's sake, it might be worth looking at costing implicit conversions as if they were constructors. Or perhaps or in addition, giving an extra benefit boost to methods taking or returning span-like values. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The conversion doesn't currently inline producing
When inlined this reduces to
/cc @jkotas @stephentoub