Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 903

System.Text.RegularExpressions performance in scripts

$
0
0
I profiled my freezing script and found that ~400 Regex.IsMatch executions on compiled regexp last 0.2 seconds!
On my local machine in pure C# the exact same regexps(even heavier) executing 200(!) times faster!

I changed regex to String.IndexOf and now script working fast.

But, why regex'es so slow in ingame scripts?

Regex example:
DisplayRegex":{"Pattern":"(this will never mathch everything|Components|Ore)","Options":9}

Viewing all articles
Browse latest Browse all 903

Trending Articles