Closed kcarthic closed 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)
if (url.startsWith(route.path))
if (url.indexOf(route.path)>-1)
the two lines not the same. >-1 not equal with startsWith. Can you substantiate the increase in performance?
>-1
startsWith
@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))
withif (url.indexOf(route.path)>-1)