dateparser
dateparser copied to clipboard
postpone timezone regex evaluation until first use - shaves off time from package import
This MR is related to issue #533 which is caused mainly by a time intensive parsing of regular expressions for timezone matching. This MR introduces a global object TzRegexCache
and moves preparation of the regexps into it. The regexps are no longer parsed on startup, but during first use instead. On my machine it shaves off about 200 ms from the import time of dateparser
thus reducing it to less than 20 % of the original import time.