-
Notifications
You must be signed in to change notification settings - Fork 60
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
Improving class loading efficiency and considering dynamic type list #919
Conversation
…n new code after underline changes related to data pack. After discussed with Hector using standard LRU_Cache instead of custom cache.
… created an non-cached version of get_class (get_class_nc) and used in get_class to avoid dynamic list issue as mentioned in comments of asyml#765 as pointed out my Hector.
please fix the "This PR fixes" line again. Please learn how to use this syntax |
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.
Please fix the conflicts and fix the doc error
Sorry forgot to remove the "[ ]" in the template. The format is now fixed. |
…at have optional list as parameter -- change to cache lower level result from "locate" method called in this method, and also provide a non-cached version (same as before) for resolving asyml#765.
Codecov Report
@@ Coverage Diff @@
## master #919 +/- ##
=======================================
Coverage 81.05% 81.06%
=======================================
Files 256 256
Lines 19851 19858 +7
=======================================
+ Hits 16091 16097 +6
- Misses 3760 3761 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…e-factoring into one method with "cached_lookup" optional flag -- by default this is true but in _get_sub_class this flag needs to set to "false" based on comments in asyml#765 (for dynamic class loading scenario).
This PR fixes #908.
This PR addresses class loading efficiency issue by adding lru_cache to get_class() method, and also resolved the concern raised in #765 about dynamic type list indata_store, so in the "is_subclass" method a special non-cached version of get_class (get_class_nc) is called instead
Possible influences of this PR.
By using a special non-cached version of get_class (get_class_nc) in "is_subclass" might cause a slight performance impact of a few percentage (to ensure correctness), in the future there might be improved ways to make the method using some kind of caching mechanism safely.
Test Conducted
testPOSTaggingNER() method in "data_pack_profiling_test" for checking performance changes (performance improved from non-lru cached versions of "get_class" in utils.py)