Most PHP-based proxy scripts really do suck and the whole concept is horrible.

PHP isn't mean to act like a proxy so no matter what code you use, it'll always be slower than a fast regular proxy.