Reduce memory allocations for building the router match tree (about 2x time reduction).