CPU Spikes and High Memory Usage

Hi Team,

Our Kong setup contains Routes with multiple Paths with regex. One observation we found with this approach is high CPU and memory utilization.

Is it not recommend to have multiple path with a single route?

Would love to understand the logic on how the Paths are analyzed in a route. Our assumption is the following

for each request:
    for each route:
        for each path in route:
            if request matches path:
                process request

With the above assumption, even if we put the path outside it still need to get processed on the route loop.

Kong Version: 2.6.0