4 ms·
Bear in mind that the operation is trivial and so the overhead cost of invoking the lambda per iteration becomes more significant. I'm not trying to dismiss th
by louthy 7y ago
Bear in mind that the operation is trivial and so the overhead cost of invoking the lambda per iteration becomes more significant. I'm not trying to dismiss the performance differences, but summing 32 million floats is not a common use-case and I think the performance differences are mostly irrelevant for those using it to (for example) sum a list of line-items for an invoice or whatever.
For anyone that needs maximum performance then they should clearly be wary of anything that requires invocation of lambdas, but the usefulness of Linq shouldn't be written off because of that - the declarative style leads to fewer bugs, more stable, maintainable and easier to read code - that in itself is a performance boost.