-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Remove the unsafe code from Kestrel #4720
Comments
Be nice to do it and not get a performance hit. For example if the Jit could recognise slice advancing and propagate bounds checking; as well as elide slice bounds checking and secondary span creation so that; in the correct pattern, it could be as near cost to a pointer bump |
@benaadams don't take this away from me |
@davidfowl, do you consider the http parser to be "kestrel"? If yes, do you think we can remove unsafe code from the parser? |
@KrzysztofCwalina yes and yes. I had a branch here in the 2.0 time frame before JIT optimizations on span and the performance hit was too big https://github.com/aspnet/KestrelHttpServer/tree/davidfowl/ideal-parser. I need to go back to it now that those things were addressed. |
This is a long running issue. We should be able to track this somehow. |
Actually, it would be great if we could quantify this and drive it down. |
List all currently known methods as a checklist? |
Yep |
Folks working on this may be interested in the conversation taking place at dotnet/runtime#41418. That issue attempts to catalog the various tl;dr: if you're removing use of |
This is more of an aspirational goal instead of something we would immediately do but we should have enough primitives in the BCL now that this is viable. Of course there might be a tiny performance hit but it might be worth it if we can remove all of the unsafe code.
cc @DamianEdwards @blowdart @halter73 @KrzysztofCwalina @benaadams
The text was updated successfully, but these errors were encountered: