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

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

Open
udlose opened this issue Oct 12, 2024 · 4 comments
Labels
discussion Indicates issues that are being discussed doc-idea Indicates issues that are suggestions for new topics Pri3 Indicates issues/PRs that are low priority
Milestone

Comments

@udlose
Copy link

udlose commented Oct 12, 2024

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!

@issues-automation issues-automation bot added the Pri3 Indicates issues/PRs that are low priority label Oct 12, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Oct 12, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Oct 12, 2024
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@steveharter steveharter added doc-idea Indicates issues that are suggestions for new topics and removed untriaged New issue has not been triaged by the area owner needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Oct 14, 2024
@steveharter steveharter added this to the Backlog milestone Oct 14, 2024
@steveharter
Copy link
Member

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.

I think the issue is where should the doc go, and for what.

The existing documentation consists of various categories (such as APIs and conceptual), and for specific "Data Types and methods/extension methods" the perf doc should probably go into each API link as appropriate, such in in the Remarks section. So, in general, we should just have individual issues for those since it is not likely there will be a concerted effort to overhaul all the APIs to add such content.

There are also blogs, some of which focus on performance exclusively including release-to-release changes such as this one for v9.

Thoughts @stephentoub ?

@steveharter steveharter added the discussion Indicates issues that are being discussed label Oct 14, 2024
@udlose
Copy link
Author

udlose commented Oct 19, 2024

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.

I think the issue is where should the doc go, and for what.

The existing documentation consists of various categories (such as APIs and conceptual), and for specific "Data Types and methods/extension methods" the perf doc should probably go into each API link as appropriate, such in in the Remarks section. So, in general, we should just have individual issues for those since it is not likely there will be a concerted effort to overhaul all the APIs to add such content.

There are also blogs, some of which focus on performance exclusively including release-to-release changes such as this one for v9.

Thoughts @stephentoub ?

I don't think that developers should have to reference anything other than the Reference API Documentation - no blogs, no release notes, etc. The API Documentation at https://learn.microsoft.com/ is where I'd expect it to be found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Indicates issues that are being discussed doc-idea Indicates issues that are suggestions for new topics Pri3 Indicates issues/PRs that are low priority
Projects
None yet
Development

No branches or pull requests

2 participants