Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom frame size computation support in Framing #5444

Merged
merged 2 commits into from
Dec 19, 2021

Conversation

ismaelhamed
Copy link
Member

Original issue: #22129

}

Parallel.ForEach(GetFutureResults(), async futureResult =>
{
Copy link
Member Author

Choose a reason for hiding this comment

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

Check this out, because introducing parallelism in tests that do not require to execute their asserts in order could save a lot of time.

This commit brought the execution time of each of both tests from 1.2 min to less than 2s

Copy link
Member

Choose a reason for hiding this comment

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

Oh wow, I wonder where else we could take advantage of this.

@ismaelhamed
Copy link
Member Author

An unrelated test in SqliteEventsByTagSpec is making one of the validations to fail.


var tempArray = new byte[4].PutInt(unchecked((int)0xFF010203), order: ByteOrder.LittleEndian);
Array.Resize(ref tempArray, 8);
var bs = ByteString.FromBytes(tempArray.PutInt(checked(0x04050607), order: ByteOrder.LittleEndian));
Copy link
Member Author

Choose a reason for hiding this comment

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

We're missing the ByteStringBuilder which would've made this chunk of code more readable

Copy link
Member

Choose a reason for hiding this comment

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

I believe that was removed in 1.3 or 1.4 and I don't recall why

@ismaelhamed ismaelhamed force-pushed the customizable-frame-size branch 2 times, most recently from df48ca5 to 77d5ffe Compare December 19, 2021 09:11
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

LGTM

}

Parallel.ForEach(GetFutureResults(), async futureResult =>
{
Copy link
Member

Choose a reason for hiding this comment

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

Oh wow, I wonder where else we could take advantage of this.

int fieldLength,
ByteOrder byteOrder,
ByteString offset,
ByteString tail)
{
var h = ByteString.FromBytes(new byte[4].PutInt(payload.Count, order: byteOrder));
Copy link
Member

Choose a reason for hiding this comment

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

With the ByteStringBuilder I bet we could also save on allocations here too...

@Aaronontheweb Aaronontheweb added this to the 1.4.30 milestone Dec 19, 2021
@Aaronontheweb Aaronontheweb enabled auto-merge (squash) December 19, 2021 19:06
@Aaronontheweb Aaronontheweb merged commit bf581e9 into akkadotnet:dev Dec 19, 2021
Aaronontheweb pushed a commit to Aaronontheweb/akka.net that referenced this pull request Dec 20, 2021
* Custom frame size computation support in Framing

* Speed up of framing spec
Aaronontheweb added a commit that referenced this pull request Dec 20, 2021
)

* remove the forced waiting on the underlying transport to start up

* racy spec fix: `BackoffOnRestartSupervisor_must_respect_maxNrOfRetries_property_of_OneForOneStrategy` (#5442)

issue was that using `AutoReset` could cause a race where if the scheduler could reset the count in-flight and throw off the estimates used by the tests. Using a `ManualReset` avoids this issue.

* deleted commented out code

* Make updates to `FishUntil` (#5433)

* Make updates to `FishUntil`

Implement nitpicks from #5430

* Nitpick

* cleaned up `FishUntilMessage`

* removed `FluentAssertions` reference

* fixed bad `TestKit.ReceiveTests`

* Custom frame size computation support in Framing (#5444)

* Custom frame size computation support in Framing

* Speed up of framing spec

* optimize `Props` `NewExpression` allocations (#5428)

per #5416 (comment)

Co-authored-by: Ismael Hamed <1279846+ismaelhamed@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants