Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving class loading efficiency and considering dynamic type list (#…
…919) * Initial commit for the performance change relating to class loadind in new code after underline changes related to data pack. After discussed with Hector using standard LRU_Cache instead of custom cache. * Option 2 for considering dynamic type list as mentioned in #765: 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 #765 as pointed out my Hector. * Fixed related method sequence issue and added doc * made lru_cache compatible with Python 3.7 * using full_class_name instead of class_name in get_class_nc * fixed black format issue * fixed lint format issue (import sequence) * fixed for lint issue (import grouping) * Fix CI warning (in ontology) * Fix "unhashable key type issue" when using LRU cache for get_class that 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 #765. * Fix comments on duplicate code of "get_class" and "get_class_nc" by re-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 #765 (for dynamic class loading scenario). * Need to remove the old "get_class_nc" signature removed in refactoring --------- Co-authored-by: Hector <hunterhector@gmail.com>
- Loading branch information