Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Don't use Vector<byte>.Dot #494

Merged
merged 1 commit into from
Dec 17, 2015
Merged

Don't use Vector<byte>.Dot #494

merged 1 commit into from
Dec 17, 2015

Conversation

benaadams
Copy link
Contributor

23% improvement in RPS

Faster implementation than using Vector<byte>.Dot

Resolves #493

Before

Running 30s test @ http://.../plaintext
32 threads and 1024 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 8.68ms 14.73ms 333.56ms 95.18%
Req/Sec 47.81k 4.58k 122.10k 90.28%
44317883 requests in 30.10s, 5.45GB read
Socket errors: connect 35, read 0, write 0, timeout 0
Requests/sec: 1472388.96

After

Running 30s test @ http://.../plaintext
32 threads and 1024 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 11.18ms 28.91ms 558.18ms 94.56%
Req/Sec 59.52k 8.66k 282.83k 93.10%
54796839 requests in 30.10s, 6.74GB read
Socket errors: connect 35, read 0, write 0, timeout 0
Requests/sec: 1820474.06

@benaadams benaadams changed the title Don't use Vector<byte>.Dot [Wip] Don't use Vector<byte>.Dot Dec 16, 2015
@benaadams benaadams changed the title [Wip] Don't use Vector<byte>.Dot Don't use Vector<byte>.Dot Dec 16, 2015
@halter73
Copy link
Member

23%! That's great. We're going to run this in our perflab along with the StringValues change to a class (dotnet/extensions#68) and report back with the combined results.

@@ -146,7 +133,6 @@ public int Seek(int char0)
}

var byte0 = (byte)char0;
var vectorStride = Vector<byte>.Count;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read that it's Jitted to a const, so can use it directly rather than cacing in variable; will try to find reference

@halter73 halter73 merged commit 4460cd3 into aspnet:dev Dec 17, 2015
@darcythomas
Copy link

What is the environment that you ran these tests on? (So I can make some apple to apple comparisons)

@halter73
Copy link
Member

It's hard to make apple-to-apple comparisons unless you run the baseline on the exact same machine.

@darcythomas
Copy link

Apple to pear comparisons perhaps :P

I was wondering if it was something "Standard-ish" like a A3 VM instance on Azure, or something...

@benaadams
Copy link
Contributor Author

@darcythomas you need to run in release (SIMD optimizations are weakened in debug; so its possible to debug them). Vector<float>.Dot is hardware accelerated, but there isn't an equivalent cpu instruction for Vector<byte>.Dot.

On a A3 VM you might max out its network first; I'm testing with G4 VMs as already above 2.3GBps sends.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants