Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-compile some date regexes #293

Merged
merged 1 commit into from
May 27, 2017

Conversation

J08nY
Copy link
Contributor

@J08nY J08nY commented Mar 21, 2017

Precompiling some regexes in date.py offers some speedup, as compiling static regexes on every function call is pointless.

Before:
before

After:
after

Test file:

import dateparser

for i in range(1000):
    date = dateparser.parse(" " * i + "12.18.2015")

@codecov-io
Copy link

codecov-io commented Mar 21, 2017

Codecov Report

Merging #293 into master will increase coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #293      +/-   ##
==========================================
+ Coverage   94.42%   94.44%   +0.01%     
==========================================
  Files          34       34              
  Lines        2960     2969       +9     
==========================================
+ Hits         2795     2804       +9     
  Misses        165      165
Impacted Files Coverage Δ
dateparser/date.py 93.13% <100%> (+0.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2726c47...8e65276. Read the comment docs.

@waqasshabbir waqasshabbir merged commit 34da488 into scrapinghub:master May 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants