Source generated SearchValues? #95179
-
I don't know, it might be stupid. If Regex can benefit from compile-time generated codes, and it's starting to use SearchValues, why not put those analysis of SearchValues.Create in compile time? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The regex source generator will emit use of SearchValues. If you instead mean why does it emit a call to Create rather than emitting the logic behind Create, there's a lot of complicated logic there and it would require making public all the implementation details that back it, which we'd like to be able to (and plan to) evolve over time, and which includes a ton of vectorization-related logic we don't want to bake into every assembly. It's not stupid. Your suggestion is actually where we started, and then we evolved it to SearchValues due to all the complications. |
Beta Was this translation helpful? Give feedback.
The regex source generator will emit use of SearchValues.
If you instead mean why does it emit a call to Create rather than emitting the logic behind Create, there's a lot of complicated logic there and it would require making public all the implementation details that back it, which we'd like to be able to (and plan to) evolve over time, and which includes a ton of vectorization-related logic we don't want to bake into every assembly.
It's not stupid. Your suggestion is actually where we started, and then w…