Skip to content

Remove instance of DateTimeOffset in Span.Finish#763

Merged
kevingosse merged 1 commit into
masterfrom
kevin/timestamp
Jun 30, 2020
Merged

Remove instance of DateTimeOffset in Span.Finish#763
kevingosse merged 1 commit into
masterfrom
kevin/timestamp

Conversation

@kevingosse

Copy link
Copy Markdown
Contributor

It looks like creating a DateTimeOffset because of the number of internal checks. We only need the Timespan in that codepath.

Benchmark:

_scope.Span.Finish();
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.329 (2004/?/20H1)
Intel Core i7-9750H CPU 2.60GHz, 1 CPU, 12 logical and 6 physical cores
  [Host]     : .NET Framework 4.8 (4.8.4180.0), X64 RyuJIT
  DefaultJob : .NET Framework 4.8 (4.8.4180.0), X64 RyuJIT

Method Mean Error StdDev Ratio RatioSD
Old 143.7 ns 2.40 ns 3.67 ns 1.00 0.00
New 119.5 ns 2.33 ns 2.29 ns 0.82 0.03

@kevingosse
kevingosse requested a review from a team as a code owner June 22, 2020 17:01
@lucaspimentel lucaspimentel added the type:performance Performance, speed, latency, resource usage (CPU, memory) label Jun 24, 2020
It looks like creating a DateTimeOffset because of the number of internal checks. We only need the Timespan in that codepath.
@kevingosse
kevingosse merged commit 22a32db into master Jun 30, 2020
@kevingosse
kevingosse deleted the kevin/timestamp branch June 30, 2020 15:42
@zacharycmontoya zacharycmontoya added this to the 1.18.2 milestone Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:performance Performance, speed, latency, resource usage (CPU, memory)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants