Improve performance of parsing Version#3992
Improve performance of parsing Version#3992hughbe wants to merge 1 commit intodotnet:masterfrom hughbe:version-parse
Conversation
|
Nice improvement, but wouldn't it be better to improve the performance of Int32.TryParse (at least for the Integer / InvariantCulture case) so that the benefit is available everywhere TryParse is used rather than just for Version? Integer parsing is much more common than version parsing. Or is the improvement somehow specific to Version? |
|
@stephentoub good suggestion, I'll take a look. |
Up to x4 perf improvement
|
@stephentoub , @hughbe , Any update on this one. Is the current change good as is and the perf improvement in Int32.TryParse is a bonus or should we only be doing it in Int32.TryParse? |
|
I would prefer we not add all of this complexity to Version unless we actually have evidence that Version parsing is a bottleneck somewhere. |
|
I agree. I'll close this! |
Up to x6 perf improvement and x7 allocation reduction by using custom specific parsing code and avoiding split allocations
Benchmark results
Benchmark code
Click Here