vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.17k stars 923 forks source link

perf(shared): avoid using regexp match #1315

Closed Mister-Hope closed 1 year ago

meteorlxy commented 1 year ago

Could you quantify how much performance does it improve?

BTW, how much does it benefit by using str[0] === '/' over str.startsWith('/') ? startsWith/endsWith should have better readability.

Mister-Hope commented 1 year ago

Could you quantify how much performance does it improve?

BTW, how much does it benefit by using str[0] === '/' over str.startsWith('/') ? startsWith/endsWith should have better readability.

20%, the latter is much more greater than 20

Mister-Hope commented 1 year ago

Any update on this?