Skip to content

Time Complexity AND Space Complexity (memory usage) are missing from Types/Methods/ExtensionMethods that are typically used for Performance Tuning #10554

@udlose

Description

@udlose

Describe the issue or suggestion

Please include BOTH Time Complexity and Space Complexity. Having Space Complexity is so important nowadays with performance efforts very frequently focused on reduction of memory consumption. This is extremely important for Data Types and methods/extension methods that are considered "go-to's" for performance tuning nowadays with performance efforts very frequently focused on reduction of memory consumption.

Currently, the only way to get a rough estimate is to write benchmarks using BenchmarkDotNet to try and measure memory consumption. However, this technique is:

  1. time-consuming
  2. results depend on how well (comprehensive) the benchmarks are written.
  3. an unreasonable ask to consumers of the libraries. It is like leaving out the description of what the types/methods do and having developers write test code to see how the types/methods work to achieve their task.

Most devs aren't going to spend the time to write comprehensive benchmarks considering that writing these benchmarks is time consuming. Thus, they end up possibly selecting the wrong type or method for their use-case. For example, trivial benchmarks with a smaller data set may appear that a method scales as O(2N) whereas a more comprehensive benchmark would show that the space complexity scales much differently as the data changes.

I do understand that keeping up with documentation is a challenge as the rate that the .NET ecosystem has increased dramatically over the years. However, consider this:

  • it is equally difficult to keep up with the Types/Methods/ExtensionMethods being added
  • most importantly, how useful are Types/Methods/ExtensionMethods that do not contain this information to those looking to properly tune and fix performance issues.

Thank you for your consideration!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low prioritydiscussionIndicates issues that are being discusseddoc-ideaIndicates issues that are suggestions for new topics

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions