String copying optimization #46361
-
Can JIT optimize this case ? string a = f();
string b = a + "\n"; // g(a + "\n")
// 'a' is not used after this line It is obvious that sine |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
I am unclear on what optimization you are asking for. What would the optimized result look like? |
Beta Was this translation helpful? Give feedback.
-
String string is immutable, string concatenation results in a new string and memory allocation. |
Beta Was this translation helpful? Give feedback.
-
Answered - not possible without escape analysis. |
Beta Was this translation helpful? Give feedback.
Answered - not possible without escape analysis.