Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Override Read/WriteByte on BrotliStream#30135

Merged
stephentoub merged 2 commits intodotnet:masterfrom
stephentoub:brotlireadwritebyte
Jun 5, 2018
Merged

Override Read/WriteByte on BrotliStream#30135
stephentoub merged 2 commits intodotnet:masterfrom
stephentoub:brotlireadwritebyte

Conversation

@stephentoub
Copy link
Member

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

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.
@joshfree joshfree requested review from JeremyKuhne and ianhays June 5, 2018 00:43
@joshfree joshfree added this to the 3.0 milestone Jun 5, 2018

for (int i = 0; i < correctUncompressedBytes.Length; i++)
{
Assert.Equal(correctUncompressedBytes[i], decompressedBytes[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use Assert.Equal for the arrays directly rather than iterating?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will change.

Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@danmoseley
Copy link
Member

@JeremyKuhne did you mean to sign off?

@stephentoub
Copy link
Member Author

@dotnet-bot test OSX x64 Debug Build please (https://github.com/dotnet/corefx/issues/30146)

@stephentoub
Copy link
Member Author

@dotnet/dnceng, what's going on with the Linux leg here? It appears to be hung waiting for a Debian test suite to complete:
https://mc.dot.net/#/user/stephentoub/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/290486404d29792fff39831694c1bcd31de6b431/workItem/System.Net.Http.Unit.Tests
image
but the log shows it's already completed running the tests:

2018-06-05 13:37:43,782: INFO: proc(54): run_and_log_output: Output: Discovering: System.Net.Http.Unit.Tests
2018-06-05 13:37:44,101: INFO: proc(54): run_and_log_output: Output: Discovered:  System.Net.Http.Unit.Tests
2018-06-05 13:37:44,290: INFO: proc(54): run_and_log_output: Output: Starting:    System.Net.Http.Unit.Tests
2018-06-05 13:37:53,852: INFO: proc(54): run_and_log_output: Output: Finished:    System.Net.Http.Unit.Tests
2018-06-05 13:37:53,861: INFO: proc(54): run_and_log_output: Output: 
2018-06-05 13:37:53,862: INFO: proc(54): run_and_log_output: Output: === TEST EXECUTION SUMMARY ===
2018-06-05 13:37:53,872: INFO: proc(54): run_and_log_output: Output:    System.Net.Http.Unit.Tests  Total: 1622, Errors: 0, Failed: 0, Skipped: 0, Time: 9.559s

@stephentoub stephentoub merged commit 10584bf into dotnet:master Jun 5, 2018
@stephentoub stephentoub deleted the brotlireadwritebyte branch June 5, 2018 16:03
@markwilkie
Copy link
Member

Tracking https://github.com/dotnet/core-eng/issues/3620 to investigate stuck leg

@sunandabalu
Copy link
Member

Taking a look at the stuck linux leg now.

@MattGal
Copy link
Member

MattGal commented Jun 5, 2018

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.

@JeremyKuhne
Copy link
Member

@JeremyKuhne did you mean to sign off?

Yes, I trusted @stephentoub to make the requested change and I didn't think it was critical.

@sunandabalu
Copy link
Member

Linux leg was stuck due to DataMigration deadlock issue, the instance was restarted to unblock the leg.

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants