Closed
Description
- profile the examples apps to determine hot paths
- setup a benchmarkdotnet project
- write benchmarks for known hot paths
- optimize based on benchmarks
Known Issues:
- improper use of
List
/IEnumerable
:- allocating a new list just to
forEach
it:
- allocating a new list just to
- using string literals instead of
const
: - Can we improve performance by providing generic overloads with constraints over type checking:
- instead of:
JsonApiDotNetCore/src/JsonApiDotNetCore/Models/Identifiable.cs
Lines 26 to 30 in 0664c3d
- can we do something like:
- instead of:
public class Identifiable<T> : IIdentifiable<T> where T : Guid {
// ...
}
- Use BaseController instead of Controller
- Use
.AsNoTracking()
on read-only queries - Use
.Attach(/*..*/)
instead of first callingGetAsync(/*..*/)
in PATCH requests
JsonApiDotNetCore/src/JsonApiDotNetCore/Data/DefaultEntityRepository.cs
Lines 120 to 133 in ef147e4