-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added branchless Math.Min calculation #24
base: main
Are you sure you want to change the base?
Conversation
a8d7fdf
to
f28c3bf
Compare
Giving this another crack now... .NET Framework Baseline
|
With Branchless Min
|
❌ Branchless Min but without Outer Loop Unrolling
|
❌ Using SIMD in .NET Framework via Vectors In defense of the code - it doesn't have
|
I tested the branchless code again for huge text and there really isn't any performance benefit which I find kinda strange. Before
After
|
For my own curiousity, I wanted to see the scale of how the performance degraded for larger strings:
This translates to the PR being... Not exactly ideal! |
Based on this tweet: https://mobile.twitter.com/badamczewski01/status/1273759277707132928
Results
Compared to Master
.NET Framework - 10 Characters: 20% slower
.NET Framework - 400 Characters: 2.7x faster
.NET Framework - 8000 Characters: 1.27x faster
.NET Framework (Threaded) - 8000 Characters: 1.53x faster
Note: When running the "Huge Text Benchmark", performance tanks - not sure why and may not even relate to the change: