Skip to content

Contains() benchmark feedback #1

@SaxxonPike

Description

@SaxxonPike

When I was looking through the article (thank you for sharing it), I noticed that the .Contains test uses a closure that creates a new array each iteration of .Count.

While it is something that happens even in code sent to me for review from time to time, I don't think that it paints the full picture. I think it would be useful to also show the impact of only creating the array once and then using .Contains on that.

When classes have static read-only tables in them (say, for comparing data against a set of fixed values) there wouldn't be any allocation for the array itself, and in this case we can measure solely the performance of .Contains.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions