Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks and LoggerMessage optimizations #91

Merged
merged 2 commits into from
Dec 14, 2023
Merged

Conversation

jeanplevesque
Copy link
Member

@jeanplevesque jeanplevesque commented Dec 14, 2023

GitHub Issue: #

Proposed Changes

  • Bug fix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes, no api changes)
  • Build or CI related changes
  • Documentation content changes
  • Other, please describe:

Description

  • Add a benchmark project to measure the performance of some common scenarios.
  • All logs now use LoggerMessage to reduce memory allocations and speed-up the execution when the log levels are disabled.

What is the current behavior?

Method Mean Allocated
CreateViewModel 2.278 μs 2023 B
CreateViewModel_WithExplicitName
ReadProperty_Unresolved 2.754 μs 1032 B
ReadProperty_Resolved 1.409 μs 896 B
SetProperty_Unresolved 19.147 μs 3016 B
SetProperty_Resolved 1.957 μs 832 B
DisposeViewModel 2.954 μs 776 B
SetProperty_Unresolved_WithListener 21.014 μs 3256 B
SetProperty_Resolved_WithListener 3.031 μs 1088 B
DisposeViewModel_WithListener 2.932 μs 776 B

What is the new behavior?

Method Mean Allocated
CreateViewModel 2.057 μs 1760 B
CreateViewModel_WithExplicitName 2.077 μs 1760 B
ReadProperty_Unresolved 2.866 μs 856 B
ReadProperty_Resolved 1.423 μs 720 B
SetProperty_Unresolved 22.519 μs 2592 B
SetProperty_Resolved 1.837 μs 656 B
DisposeViewModel 1.340 μs 600 B
SetProperty_Unresolved_WithListener 21.484 μs 2616 B
SetProperty_Resolved_WithListener 2.303 μs 680 B
DisposeViewModel_WithListener 1.301 μs 600 B

Impact on version

  • Major (Public API was modified.)
    • Public constructs (class, struct, delegate, enum, etc.) were removed or renamed.
    • Public members were removed or renamed.
    • Public method signatures were changed or renamed.
  • Minor (Public API was extended.)
    • Public constructs, members, or overloads were added.
  • Patch (Public API was unchanged.)
    • A bug in behavior was fixed.
    • Documentation was changed.
  • None (The library is unchanged.)
    • Only code under the build folder was changed.
    • Only code under the .github folder was changed.

Checklist

Please check that your PR fulfills the following requirements:

  • Documentation has been added/updated.
  • Automated Unit / Integration tests for the changes have been added/updated.
  • Updated BREAKING_CHANGES.md (if you introduced a breaking change).
  • Your conventional commits are aligned with the Impact on version section.
    • The version bump is minor even though this is a patch because it contains a minor breaking change (bump of nuget dependency versions) .

Other information

@jeanplevesque jeanplevesque merged commit 3465c55 into main Dec 14, 2023
4 checks passed
@jeanplevesque jeanplevesque deleted the dev/jpl/benchmarks branch December 14, 2023 19:21
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.

3 participants