Skip to content

Kestrel should create strings using newer idiomatic method #8978

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

Closed
benaadams opened this issue Apr 2, 2019 · 6 comments
Closed

Kestrel should create strings using newer idiomatic method #8978

benaadams opened this issue Apr 2, 2019 · 6 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions help wanted Up for grabs. We would accept a PR to help resolve this issue Perf
Milestone

Comments

@benaadams
Copy link
Member

benaadams commented Apr 2, 2019

Currently uses string key = new string('\0', keyLength) and then mutates with fixed.

Should use something more like string.Create

However, attention needs to be given to avoid any performance regressions.

/cc @GrabYourPitchforks @davidfowl

@gfoidl
Copy link
Member

gfoidl commented Apr 2, 2019

to avoid any performance regressions

Especially on small string-lengths, as the cost for the delegate invocation may be quite high in relation to actual work. new string(Span) may be faster in these cases.

@GrabYourPitchforks
Copy link
Member

Thanks for opening this! 😃

@analogrelay analogrelay added this to the Backlog milestone Jun 18, 2019
@analogrelay analogrelay added good first issue Good for newcomers. help wanted Up for grabs. We would accept a PR to help resolve this issue Perf and removed triage-review good first issue Good for newcomers. labels Jun 18, 2019
@gfoidl
Copy link
Member

gfoidl commented Dec 2, 2019

FYI: I gave this a try. Perf results don't look so bad so far, but I need more testing for the other methods, then I'll submit a PR.

@GrabYourPitchforks
Copy link
Member

I imagine that once static function pointers come online there would be string.Create overloads that would allow using those, which should also help eke out just a little bit greater perf.

@gfoidl
Copy link
Member

gfoidl commented Dec 3, 2019

Yeah, I hope so too. That can open a door for a lot of "delegate" usages, and make some generic-struct-tricks obsolete.

@gfoidl
Copy link
Member

gfoidl commented Feb 11, 2020

@halter73 this issue can be closed, as the PR got merged?

@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2020
@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions help wanted Up for grabs. We would accept a PR to help resolve this issue Perf
Projects
None yet
Development

No branches or pull requests

6 participants