moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
292 stars 119 forks source link

Performance improvement - Minor change #285

Closed kcarthic closed 2 years ago

kcarthic commented 2 years ago

@icebob Can improve performance of routes lookup File: src/index.js Line: 185 You can improve lookup speed by ~2x by changing if (url.startsWith(route.path)) with if (url.indexOf(route.path)>-1)

icebob commented 2 years ago

the two lines not the same. >-1 not equal with startsWith. Can you substantiate the increase in performance?