Skip to content

Refactored type handler benchmarks - #2058

Merged
YohDeadfall merged 2 commits into
npgsql:devfrom
YohDeadfall:HandlerBenchmarks
Jul 20, 2018
Merged

YohDeadfall merged 2 commits into
npgsql:devfrom
YohDeadfall:HandlerBenchmarks

Conversation

@YohDeadfall

Copy link
Copy Markdown
Contributor

No description provided.

@YohDeadfall
YohDeadfall requested a review from roji July 19, 2018 20:18
@YohDeadfall

Copy link
Copy Markdown
Contributor Author

@roji Please rerun Travis CI.

@roji

roji commented Jul 20, 2018

Copy link
Copy Markdown
Member

Done.

The WaitWithKeepalive test fails somewhat regularly, we should take a look (opened #2070).

@roji roji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

But one note about Values and ValuesOverride... The type of Values is currently IEnumerable<T>, which means that instances are potentially on the fly as the benchmark is running. For example, in the text case new string() is executed as the IEnumerable is traversed.

I'm not sure how BenchmarkDotNet implements ParamsSource, but wouldn't it be safer to simply call ToArray() on the IEnumerable, creating a simple array? This way we're sure nothing happens as the benchmark is being executed?

@YohDeadfall

Copy link
Copy Markdown
Contributor Author

It does it internally (source), so from the API design point of view it's better to return something readonly which an IEnumerable<T> is.

@roji

roji commented Jul 20, 2018

Copy link
Copy Markdown
Member

In that case it looks good to go.

@YohDeadfall
YohDeadfall merged commit 01d4cab into npgsql:dev Jul 20, 2018
@YohDeadfall
YohDeadfall deleted the HandlerBenchmarks branch July 20, 2018 08:02
roji added a commit to roji/Npgsql that referenced this pull request Oct 26, 2021
Interval, NpgsqlRange<ZonedDateTime> etc.

Fixes npgsql#2059
Fixes npgsql#2058
roji added a commit that referenced this pull request Oct 26, 2021
Interval, NpgsqlRange<ZonedDateTime> etc.

Fixes #2059
Fixes #2058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants