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

Create benchmarks on CPU and memory #623

Closed
angularsen opened this issue Mar 3, 2019 · 2 comments
Closed

Create benchmarks on CPU and memory #623

angularsen opened this issue Mar 3, 2019 · 2 comments

Comments

@angularsen
Copy link
Owner

To create a baseline when discussing moving from struct to class (#372,#500) or changing the internal representation from double to decimal (#372) or even to a rational value (#478).

Any changes should be compared to a baseline so we know how much better/worse things get in terms of CPU and memory and in both absolute and relative terms.

  1. CPU time
  2. Garbage collector pressure
  3. Memory footprint
    • Single quantity instances
    • Array of quantity instances

Example of things to test on:

  • Construction: constructors and From methods
  • Conversion: .As(), .ToUnit() and conversion properties like .Centimeters
  • ToString: and its various overloads
  • Parsing: Parse and TryParse methods
  • Dynamic: The above, but dynamically via IQuantity and QuantityInfo types. Should introduce additional boxing and extra conditions.

I suggest using Benchmark.NET, I have good experience with it.

@angularsen angularsen changed the title Create benchmarks on performance and memory Create benchmarks on CPU and memory Mar 3, 2019
@tmilnthorp
Copy link
Collaborator

Benchmark.NET looks pretty awesome. I have no experience with it, but looks like it will do what we need it to.

@angularsen
Copy link
Owner Author

Fixed in #637. Can be improved more later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants