Simpler dispatch code: please test!

114 views
Skip to first unread message

Michael Snoyman

unread,
Mar 4, 2014, 7:58:10 AM3/4/14
to yeso...@googlegroups.com, Christopher Done
When doing some performance analysis, Chris and I discovered that the current dispatch code was not as efficient as we'd hoped. In addition, the generated code was incredibly complicated for a human to read and understand.

In response, I've created a new branch in the yesod repo[1] called simpler-dispatch. The new code *should* be a drop-in replacement for the current code, except that it requires two additional language extensions: ViewPatterns and OverloadedStrings.

I've run the existing test suite against it, and tested the FP Complete code base against it, and everything seems to be working as expected. But I'd appreciate if others could install from the branch and test it out. (Extra props if it makes your website 50 times faster :)).

And as a final question: does anyone have a reason why making ViewPatterns and OverloadedStrings required extensions would be a problem?

Since I'm sure everyone's curious, here's a simple benchmark of the new code (dispatch1 is the old version, dispatch2 is the new):

benchmarking dispatch1
mean: 1.906022 ms, lb 1.904000 ms, ub 1.908130 ms, ci 0.950
std dev: 10.64242 us, lb 9.854722 us, ub 11.60953 us, ci 0.950

benchmarking dispatch2
mean: 1.141337 ms, lb 1.140918 ms, ub 1.141908 ms, ci 0.950
std dev: 2.482313 us, lb 1.909546 us, ub 3.996382 us, ci 0.950

benchmarking dispatch1a
mean: 2.011685 ms, lb 2.009181 ms, ub 2.014391 ms, ci 0.950
std dev: 13.36423 us, lb 12.25406 us, ub 14.61032 us, ci 0.950

benchmarking dispatch2a
mean: 1.197385 ms, lb 1.196627 ms, ub 1.198281 ms, ci 0.950
std dev: 4.219332 us, lb 3.580967 us, ub 5.328656 us, ci 0.950

Reply all
Reply to author
Forward
0 new messages