chansen/p5-http-tiny — pull request #40 by JRaspass (2014-05-05 00:53:50+00:00)
Title: Optimise _split_url for speed.

Given it's called for every request it seemed a logical choice.
Crude benchmark directly calling the sub showed a 30% improvement.

- Store $authority directly in $host, avoids the copy in
the likely scenario of there being no auth.
- Use index rather than a regex to detect auth in the host.
- If that found an @ we can now directly chop up the host
using substr, no repeated searching for @.
- Avoid the redundant do block in the port ternary.
- Only lowercase the host at return time.