dotnet / dotnet/dotnet-api-docs

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

Offen
#10,554 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
discussion doc-idea Pri3
Vorherrschende Sprache
C#
Sterne
949
Forks
1.7k
Ø Merge
2 T. 19 Std.
Gemergte PRs (30 T.)
52

Beschreibung

### 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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginnen Sie mit der Durchsicht der .NET API reference documentation und der Diskussion im Issue über auf BenchmarkDotNet basierende Speichermessungen. Legen Sie den Umfang und das Format für die Berichterstattung über Zeit- und Speicherkomplexität für die relevanten Typen, Methoden und Erweiterungsmethoden fest und dokumentieren Sie die vereinbarten Informationen konsistent.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp
Bereich
documentation
Issue-Typ
Dokumentation
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.