backend: Optimize route filtering
backend: Optimize route filtering

This introduces a new OptionalFilter enum to determine if a filter should be processed or not. This avoids boxing and dynamic dispatch, and brings the performance back to what it was before 926ff3f5119e54e8308d3d237f40ce818f5fc55a.

Acizza/srfinder,Acizza/srfinder,Acizza/srfinder,Acizza/srfinder