-
Notifications
You must be signed in to change notification settings - Fork 523
Skip Null check and zero length checks of Pointers #541
Comments
Interesting :) |
This one is also nice to know Optimize generated code for Fixed statement. Looks like a clr or roslyn issue |
+1 |
Yes, all that I could find. I skipped 1 or 2 because they didn't have much impact. |
@halter73 I think @benaadams did already change some in his PR |
I also noticed @benaadams used the same pattern in at least one of his PRs. Thanks! Just wanted to double check before closing. |
@Anderman is making me up my game :) |
Ha, Thx there still is many things that can be improved |
@Anderman No doubt there are many more things that can be improved, but we've decided we are going to lock down stop accepting new perf related PRs prior to our 1.0 release. This is meant to give us more time to focus on other things like stability and security. |
* Faster unsafe pointers * Moved return statements inside fixed scope See: aspnet/KestrelHttpServer#541
pointers to byte arrays are use as
fixed(byte* ptr arr)
the code generated will check if this is an null or zero length array
To skip these tests the statement can be written as
fixed(byte* ptr &arr[0])
see generated code
fixed(byte* ptr arr)
fixed(byte* ptr &arr[0])
The text was updated successfully, but these errors were encountered: