RequestFactory: optimized script path detection performance