Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Bring in BuffersExtensions WriteMultiSegment#1918

Closed
benaadams wants to merge 7 commits into
aspnet:devfrom
benaadams:WriteMultiSegment
Closed

Bring in BuffersExtensions WriteMultiSegment#1918
benaadams wants to merge 7 commits into
aspnet:devfrom
benaadams:WriteMultiSegment

Conversation

@benaadams
Copy link
Copy Markdown
Contributor

No description provided.

@davidfowl
Copy link
Copy Markdown
Member

When I tired this, nothing got faster.

@benaadams
Copy link
Copy Markdown
Contributor Author

When I tired this, nothing got faster.

Spoliers... am still running benchmarks

@benaadams
Copy link
Copy Markdown
Contributor Author

Yeah no real change, wonder about skipping GetSpan

image

@benaadams benaadams force-pushed the WriteMultiSegment branch from aec44eb to b1c7bdc Compare April 9, 2018 15:23
@benaadams
Copy link
Copy Markdown
Contributor Author

Still not a great difference :(

@benaadams benaadams force-pushed the WriteMultiSegment branch 2 times, most recently from d0bfd5c to 6b16de6 Compare April 9, 2018 19:04
var packer = Packer.Create(output, PackerCompatibilityOptions.None);
switch (message)

if (message is InvocationMessage invocationMessage)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmmm?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"Pattern matching switch generates junkier code than if" f9ce436

; Total bytes of code 657, prolog size 10 for method
MessagePackHubProtocol:WriteMessageCore(ref,ref):this

vs

; Total bytes of code 612, prolog size 10 for method
MessagePackHubProtocol:WriteMessageCore(ref,ref):this

Still seems noisy though

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They both generate junky code; I think so the stack trace unwinds through the correct point :-/

@benaadams benaadams force-pushed the WriteMultiSegment branch from 6b16de6 to e784a5e Compare April 9, 2018 20:30
; Total bytes of code 657, prolog size 10 for method
MessagePackHubProtocol:WriteMessageCore(ref,ref):this

vs

; Total bytes of code 612, prolog size 10 for method
MessagePackHubProtocol:WriteMessageCore(ref,ref):this

Still seems noisy though
; Total bytes of code 195, prolog size 11 for method
MemoryBufferWriter:Reset():this

vs

; Total bytes of code 181, prolog size 8 for method
MemoryBufferWriter:Reset():this
@benaadams
Copy link
Copy Markdown
Contributor Author

asm is better; but the benchmarks are saying its underwhelming :(

@benaadams benaadams closed this Apr 9, 2018
@benaadams benaadams deleted the WriteMultiSegment branch April 10, 2018 14:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants