Open chiefGui opened 10 years ago
Hello guys.
In this conditional pattern doc, you say:
Using the normal pattern will generally outperform the regex (alternative method 1) in a loop, [...]"
Then I made a little test – still doubtful, but can give us an idea: Conditional Expressions Difference.
I really was expecting that regex would be faster/better outside a loop – as I outputted on the alert() – but it doesn't seem to happen.
alert()
Yes, I know – jsPerf isn't the most trustful way of performance rating, but as I said, it can give us a starting point.
So, what does "outperform" really means?
Hello guys.
In this conditional pattern doc, you say:
Then I made a little test – still doubtful, but can give us an idea: Conditional Expressions Difference.
I really was expecting that regex would be faster/better outside a loop – as I outputted on the
alert()
– but it doesn't seem to happen.Yes, I know – jsPerf isn't the most trustful way of performance rating, but as I said, it can give us a starting point.
So, what does "outperform" really means?