Everything You Want to Know About the Record Type in .NET: Performance

DotNetDave shared a great article about the performance working with Records in .Net #mustRead


In my article titled Everything You Want to Know About the Record Type in .NET 5… But Were Afraid to Ask that I wrote in early 2021, I introduced readers to the new record type introduced in .NET 5 and why, as a class author, I like it. In this article, I will drill down into the performance using the record type.

For all the examples in this article, the record I am using for comparison is PersonRecord and the Person (POCO) class in my OSS assembly that I use for testing. Both have the same properties and data validation.

Creating a Record Type in Memory

First, let us look at the performance difference creating a normal Person object compared to a PersonRecord object. Depending on if you are using .NET 5 or 6, overall, Person is more performant. But, in .NET 6, the speed is much better.

View original post 634 more words

1 comment

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: