4 ms·
Need I point out that one can avoid both the issues highlighted here by just using Tcl? Regexps in Tcl use a non-backtracking implementation which handles such
by cmacleod4 4y ago
Need I point out that one can avoid both the issues highlighted here by just using Tcl?
Regexps in Tcl use a non-backtracking implementation which handles such cases with minimal slowdown, e.g. the example shown with 16 and 32-character inputs:
(dep) 7 % timerate {regexp (a+)+b aaaaaaaaaaaaaaaa}
0.353737 µs/# 2826961 # 2826961 #/sec 1000.000 net-ms
(dep) 8 % timerate {regexp (a+)+b aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
0.412612 µs/# 2423587 # 2423587 #/sec 1000.000 net-ms
One discussion of this can be found at https://comp.lang.tcl.narkive.com/XPVME8zS/tcl-regexp-performance https://comp.lang.tcl.narkive.com/XPVME8zS/tcl-regexp-perfor... .
Tcl's threading implementation has no GIL, which not only avoids the type of lock-up described here, but also allows performance to scale to use all cores of your machine, see: https://www.hammerdb.com/blog/uncategorized/why-tcl-is-700-faster-than-python-for-database-benchmarking/ https://www.hammerdb.com/blog/uncategorized/why-tcl-is-700-f... .