Improve SIMILAR TO performance ------------------------------ Key: CORE-3919 URL: http://tracker.firebirdsql.org/browse/CORE-3919 Project: Firebird Core Issue Type: Improvement Affects Versions: 3.0 Initial Reporter: Adriano dos Santos Fernandes
There is two tickets (CORE-3773 and CORE-3858) about SIMILAR TO performance. Both are related to the algorithm (NFA-based, without heuristics) used, which may cause exponential backtracking for special patterns and/or long texts. The improvement performance of this ticket is about re-implementation of the current algorithm. With test from CORE-3858, time decreases from 165 seconds to 101 seconds. Times in seconds for test: echo "set stats on; select iif('aaaaaaaaaaabaaaaaabaaaaaaaaaab' SIMILAR TO '(a+b?)+a+' escape '\', 1, 0) from rdb\$database;" | isql -q t.fdb (iterative version is the one used, and recursive version is deactivated due to stack overflow problems) Before: gcc iterative: 11,83 gcc recursive: 4,74 clang iterative: 9,73 clang recursive: 3,45 After: gcc iterative: 5,54 gcc recursive: 3,97 clang iterative: 3,85 clang recursive: 3,69 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel