Performance of Value Tuples in C# - 1
06/03/2018
C# 7 has introduced lots of new features. One of them is the new ValueTuples
Instead of discussing the compiler syntax and usage of value tuples, I suggest to search on the web, here is one great post C# 7 Series, Part 1: Value Tuples about it.
In this post I will do a small micro-benchmarking and also look at IL Code got generated for multiple return types.I will use an example where I have a possibility to return two values, but previously we have used one result parameter and out parameter: a TryParse
method. It is made up sample code though, probably you would never have this business logic in a real application.