-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.MemoryenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue
Milestone
Description
For Span/ReadOnlySpan DangerousCreate method, should we remove the following test cases to increase performance:
- SpanTests - DangerousCreateNullObject
- SpanTests - DangerousCreateBadLength
- ReadOnlySpanTests - DangerousCreateNullObject
- ReadOnlySpanTests - DangerousCreateBadLength
It was suggested that the Fast and Slow Span implementations should not do the check/throw on null object or negative lengths to speed up creation of the instance of Span/ReadOnlySpan.
That is, these checks should be removed:
public static ReadOnlySpan<T> DangerousCreate(object obj, ref T objectData, int length)
{
if (obj == null)
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.obj);
if (length < 0)
ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument.length);Should they be removed?
Metadata
Metadata
Assignees
Labels
area-System.MemoryenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorstenet-performancePerformance related issuePerformance related issue