Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Why lambda is faster than other approaches? - C#
C
C#
•
14mo ago
•
9 replies
Green Leaf 🦄
Why lambda is faster than other approaches?
I
've been working on some algorithm and discovered that if the
Sort
Sort
function uses a lambda comparer
, it is faster than if it uses a comparer type
. So I run this test with BenchmarkDotNet and the result really puzzles me
. Why is that
?
https://gist.github.com/laicasaane/d51193a0a4aff7c6df6c1bb89a66bdc9
Gist
Test Sort with lambda, local function, comparer type
Test Sort with lambda
, local function
, comparer type
- Result
.log
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
which is faster
C
C# / help
3y ago
✅ Is there a more efficient way other than ConcurrentQueue?
C
C# / help
6mo ago
✅ My other post is closed idk why but
C
C# / help
2y ago
❔ What is available approaches to communicate between Microservices
C
C# / help
3y ago