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
- Lingua principale
- C#
- Stelle
- 950
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
### 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!
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Iniziare esaminando la .NET API reference documentation e la discussione dell'issue sulle misurazioni della memoria basate su BenchmarkDotNet. Definire l'ambito e il formato per riportare la complessità temporale e spaziale dei tipi, metodi e metodi di estensione pertinenti, quindi documentare in modo coerente le informazioni concordate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100