Override Read/WriteByte on BrotliStream#30135
Conversation
The base Stream.Read/WriteByte allocate a byte[1] array and delegate to the corresponding array-based Read/Write methods. We can do much better on BrolitStream (as we can on most of our Stream-derived types), especially since we already have span-based Read/Write methods, so we can just call those with a span for the single byte.
|
|
||
| for (int i = 0; i < correctUncompressedBytes.Length; i++) | ||
| { | ||
| Assert.Equal(correctUncompressedBytes[i], decompressedBytes[i]); |
There was a problem hiding this comment.
Is it possible to use Assert.Equal for the arrays directly rather than iterating?
|
@JeremyKuhne did you mean to sign off? |
|
@dotnet-bot test OSX x64 Debug Build please (https://github.com/dotnet/corefx/issues/30146) |
|
@dotnet/dnceng, what's going on with the Linux leg here? It appears to be hung waiting for a Debian test suite to complete: |
|
Tracking https://github.com/dotnet/core-eng/issues/3620 to investigate stuck leg |
|
Taking a look at the stuck linux leg now. |
|
All the logs and such look totally normal and healthy; I'd suggest focusing your search on the SQL DB if the events for this work item are still there (can save lots of time), or using the eventhub scraping tool if not. |
Yes, I trusted @stephentoub to make the requested change and I didn't think it was critical. |
|
Linux leg was stuck due to DataMigration deadlock issue, the instance was restarted to unblock the leg. |
* Override Read/WriteByte on BrotliStream The base Stream.Read/WriteByte allocate a byte[1] array and delegate to the corresponding array-based Read/Write methods. We can do much better on BrolitStream (as we can on most of our Stream-derived types), especially since we already have span-based Read/Write methods, so we can just call those with a span for the single byte. * Use Assert.Equal in Brotli tests instead of comparison loop Commit migrated from dotnet/corefx@10584bf

The base Stream.Read/WriteByte allocate a byte[1] array and delegate to the corresponding array-based Read/Write methods. We can do much better on BrolitStream (as we can on most of our Stream-derived types), especially since we already have span-based Read/Write methods, so we can just call those with a span for the single byte.
cc: @ianhays, @joshfree