h11 icon indicating copy to clipboard operation
h11 copied to clipboard

Inline the validate() function

Open bluetech opened this issue 5 years ago • 2 comments

This is based on #118, please look at the last commit only. (Sorry for the jungle of PRs, I can rebase them whichever way).


It somewhat obscures the control flow and adds some non-trivial overhead.

Inline it in favor of the direct match/if combination.

On the bench/ microbenchmark:

Before: 10700.2 requests/sec
After : 11334.0 requests/sec

bluetech avatar Nov 18 '20 21:11 bluetech

I also prefer this approach, however as it more of a preference question I'll wait for more views.

pgjones avatar May 16 '21 10:05 pgjones

I also prefer this approach, however as it more of a preference question I'll wait for more views.

From the last commit, that seems okay as a trade-off, yup. Tho I'd probably also want to review again once there's an up to date PR for it, and have the micorbenchmark re-run against the latest PR-against-master.

lovelydinosaur avatar May 17 '21 14:05 lovelydinosaur