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

perf: Improve performance when reading dynamic properties. #98

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

jeanplevesque
Copy link
Member

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: Performance optimizations

What is the current behavior?

Method Mean Gen0 Gen1 Allocated
GetFromValue_Unresolved 427.69 ns 0.0405 0.0401 256 B
GetFromObservable_Unresolved 544.88 ns 0.0477 0.0467 304 B
GetFromValue_Resolved 46.09 ns 0.0191 - 120 B
GetFromObservable_Resolved 52.72 ns 0.0204 - 128 B

What is the new behavior?

  • Faster reads and less memory allocations.
  • No allocations when reading resolved properties.
Method Mean Gen0 Gen1 Allocated
GetFromValue_Unresolved 317.01 ns 0.0253 0.0248 160 B
GetFromObservable_Unresolved 343.79 ns 0.0315 0.0310 200 B
GetFromValue_Resolved 23.23 ns - - -
GetFromObservable_Resolved 30.41 ns - - -

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.
    • Only code in the Benchmarks project 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.

Other information

@jeanplevesque jeanplevesque marked this pull request as ready for review January 10, 2024 15:39
@jeanplevesque jeanplevesque requested a review from a team January 10, 2024 15:43
@jeanplevesque jeanplevesque merged commit 8f59a7b into main Jan 10, 2024
4 checks passed
@jeanplevesque jeanplevesque deleted the dev/jpl/perf-allocations branch January 10, 2024 16:26
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.

4 participants