rfe12577: make parse-uri between 12 and 30% faster

There are plenty of tests that cover the changes.

Change-Id: Ie29d7903b41176be5f53e328d3bf603d0c1a5d7e