-
Notifications
You must be signed in to change notification settings - Fork 35
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
[Question] Span_FirstF and List_FirstF are slower than just calling foreach -> Why? #22
Comments
…ower than just calling foreach -> Why?
try making a local copy of the array inside the function calling FirstF |
I do not understand, In the Benchmark, or in the Implementation of
|
in the benchmark |
I've shown the code, isn't is generating a local for each of the benchmarks ? |
|
|
These are such small differences (nanoseconds) it might just be the function call overhead of calling into FirstF. Like the difference is pretty close to the latency of a single memory location lookup |
Because the function is not the same for each run ( Span is quick, see the difference for Sum, i.e. Span.SumFor is slower than the Span.SumFastF
|
Checking back through the Benchmarks...
|
are you testing with .net core? span is slow when not on .net core |
Picture states .Net 4.7.2, so nope. |
…lower than just calling foreach -> Why?
yeah so span being slow is to be expected, nothing to be done about it. |
So would it be prudent to move the Linq for |
…er a span Create jackmott#22: [Question] Span_FirstF and List_FirstF are slower than just calling foreach -> Why? Span this jackmott#24: [Enhancement] DefaultIfEmptyF should be implemented Add Span jackmott#25: [Enhancement] Please also target .net4.8 and Benchmark
The text was updated successfully, but these errors were encountered: