aspnet / Routing

[Archived] Middleware for routing requests to application logic. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
272 stars 122 forks source link

Various CandateSet/EndpointSelector stuff #822

Closed rynowak closed 6 years ago

rynowak commented 6 years ago

MatcherAzureBenchmark

Before

Method Mean Error StdDev Op/s Scaled ScaledSD Gen 0 Allocated
Baseline 405.2 ns 7.557 ns 6.699 ns 2,468,172.6 1.00 0.00 - 3.91 KB
Dfa 791.7 ns 5.934 ns 4.955 ns 1,263,056.2 1.95 0.03 0.4883 46.53 KB

After

Method Mean Error StdDev Op/s Scaled ScaledSD Gen 0 Allocated
Baseline 406.2 ns 11.769 ns 10.433 ns 2,461,840.8 1.00 0.00 - 3.91 KB
Dfa 767.5 ns 4.155 ns 3.683 ns 1,302,874.3 1.89 0.05 0.4883 48.09 KB

MatcherSingleEntryBenchmark

Before

Method Mean Error StdDev Op/s Scaled ScaledSD Gen 0 Allocated
Baseline 100.8 ns 1.386 ns 1.228 ns 9,924,813.0 1.00 0.00 0.0005 40 B
Dfa 184.3 ns 2.451 ns 2.293 ns 5,426,032.8 1.83 0.03 0.0017 168 B
LegacyTreeRouter 946.3 ns 9.048 ns 8.021 ns 1,056,709.0 9.39 0.13 0.0057 488 B
LegacyRouter 661.8 ns 4.762 ns 3.444 ns 1,510,964.7 6.57 0.08 0.0038 344 B

After

Method Mean Error StdDev Op/s Scaled ScaledSD Gen 0 Allocated
Baseline 101.8 ns 0.5083 ns 0.4755 ns 9,823,401.5 1.00 0.00 0.0005 40 B
Dfa 151.9 ns 1.4849 ns 1.3163 ns 6,583,366.1 1.49 0.01 0.0021 184 B
LegacyTreeRouter 881.8 ns 3.5295 ns 3.3015 ns 1,134,059.0 8.66 0.05 0.0057 504 B
LegacyRouter 606.1 ns 2.2059 ns 1.9555 ns 1,650,011.2 5.95 0.03 0.0038 360 B

So the CandidateSet + DefaultEndpointSelector changes had a significant improvement on the plaintext scenario.

rynowak commented 6 years ago

@JamesNK updated. This will require a reaction in MVC - I'll get that going.

rynowak commented 6 years ago

https://github.com/aspnet/Mvc/pull/8522