Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Aug 17, 2020

It is common to use HTTP method matching with a single method, e.g. MapGet. PR adds a jump table that avoids dictionary lookup of method name when there is only one method.

@JamesNK JamesNK requested a review from javiercn as a code owner August 17, 2020 02:48
@ghost ghost added the area-servers label Aug 17, 2020
@davidfowl
Copy link
Member

Where are the performance numbers?

@JamesNK
Copy link
Member Author

JamesNK commented Aug 17, 2020

|                     Method |     Mean |    Error |   StdDev |         Op/s | Gen 0 | Gen 1 | Gen 2 | Allocated |
|--------------------------- |---------:|---------:|---------:|-------------:|------:|------:|------:|----------:|
|  DictionaryPolicyJumpTable | 46.30 ns | 0.576 ns | 0.539 ns | 21,596,146.2 |     - |     - |     - |         - |
| SingleEntryPolicyJumpTable | 28.31 ns | 0.239 ns | 0.223 ns | 35,328,279.0 |     - |     - |     - |         - |

@JamesNK JamesNK changed the base branch from master to release/5.0 August 17, 2020 21:42
@JamesNK JamesNK added this to the 5.0.0-rc1 milestone Aug 18, 2020
@JamesNK JamesNK added the tell-mode Indicates a PR which is being merged during tell-mode label Aug 18, 2020
@JamesNK
Copy link
Member Author

JamesNK commented Aug 18, 2020

ping @javiercn

@JamesNK JamesNK force-pushed the jamesnk/httpmethodmatcherpolicy branch from ba5186b to 704b078 Compare August 18, 2020 09:42
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Looks great!

@JamesNK JamesNK changed the title HTTP method matching: Simple jump table optimized for a single method HTTP method matching: Jump table optimized for a single method Aug 18, 2020
@JamesNK JamesNK merged commit edf25b7 into release/5.0 Aug 18, 2020
@JamesNK JamesNK deleted the jamesnk/httpmethodmatcherpolicy branch August 18, 2020 19:41
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions tell-mode Indicates a PR which is being merged during tell-mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants