-
Notifications
You must be signed in to change notification settings - Fork 466
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
Attempted to implement lazy loading of languages data #294
Attempted to implement lazy loading of languages data #294
Conversation
Codecov Report
@@ Coverage Diff @@
## master #294 +/- ##
========================================
+ Coverage 97.61% 98% +0.38%
========================================
Files 20 20
Lines 1674 1650 -24
========================================
- Hits 1634 1617 -17
+ Misses 40 33 -7
Continue to review full report at Codecov.
|
I checked the times of importing of dateparser in current system and after making changes. Current :
After making changes :
|
@waqasshabbir could you please have a look at this PR. I have implemented on-demand loading of languages data and avoided loading at import time to reduce import time and have better performance in long run. |
dateparser/date.py
Outdated
self.languages=languages | ||
self.are_languages_passed = bool(languages) | ||
|
||
available_language_shortnames=['en', 'ar', 'be', 'bg', 'bn', 'cs', 'da', 'de', 'es', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must not mix data loading logic with this class here especially when we can completely avoid it by making necessary changes in LanguageDataLoader
class.
Thanks for the review @waqasshabbir . I have made required changes to implement loading logic entirely in LanguageDataLoader. |
…d other changes to make parsing more efficient
What's the status of this? I would love to take advantage of the speedup |
Attempted to implement lazy loading to resolve issue #253 .