faster path building
more aggressive optimizations