Performance and practice of lazy regex?

后端 未结 3 2077
轮回少年
轮回少年 2021-01-14 07:03

I read on the internet i should avoid lazy regex because of \'worse\' performance and \'bad\' practice. I never seen an example of either. I havent heard of an app

3条回答
  •  粉色の甜心
    2021-01-14 07:41

    It depends on your target audience.

    If you don't care about optimization, don't have high traffic and so on, it probably won't make a difference, and a lot of other optimization techniques that get you an extra 1/4 of a second won't either.

    Lazy regex can take a lot more time performance-wise, but you may not notice that performance boost unless you're dealing with thousands of lines that its searching through or being done repetitively on a page.

提交回复
热议问题