3 ms·
You can still easily blow up memory with unions, which makes it easy to lock up Linux, which notoriously performs poorly under memory pressure.
by wahern 7y ago
You can still easily blow up memory with unions, which makes it easy to lock up Linux, which notoriously performs poorly under memory pressure.
- saagarjha 7y agoJust set a memory limit on the process.
- lilyball 7y agoA non-backtracking regex engine like re2 should be linear with respect to the regex size and can be configured with a memory budget.
- wahern 7y agoThe number of DFA states can explode exponentially. It's a real problem, especially if you're compiling untrusted expressions off the internet. Evaluation is linear, but you're just evaluating your own password. In this scenario, it may make sense to just use a simple backtracking implementation, though as you alluded to early there aren't many simple ones around.
- pjscott 7y agoRE2, at least, will fall back to an NFA-based matcher if things get too pathological.