Ports: Optimize Matching Routine

Integrate some basic perfect minimal hashing to speed up dispatch.
Overall speedup on the first tested machine is ~10x.