-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
add parse_ixbrl_diskcache_version to accelarate access parsed ixbrls. #90
base: main
Are you sure you want to change the base?
Conversation
The logical content of public xbrl can be thought unchangeable, so its parsed result can be cached in disk to accelerate accessing lately. For it do not parsed xml to python object again lately.
The logical content of public xbrl can be thought unchangeable, so its parsed result can be cached in disk to accelerate accessing lately. For it do not parsed xml to python object again lately. so parse_ixbrl_diskcache_version is faster than parse_ixbrl
Hey, Thanks for your pull request. I wonder what the use case for this is. Lines 509 to 510 in 61a518e
This speeds up the parsing dramatically because submissions from the same year and country usually use the same taxonomies. If you for example parse 1000 xbrl documents from the SEC, the US-gaap taxonomy will only be loaded once from the file system and then cached into memory. However, if I see correctly you want to store the python object of the XBRL instance to the file system, correct? |
@fhopecc Thanks for your interest in If you want me to merge the changes from you I would ask you to use different pull requests for thematically different changes. Thanks, |
The logical content of public xbrl can be thought unchangeable lately when it is submited or publiced by the organizations, so its parsed result can be cached in disk to accelerate accessing lately. For HttpCache caches xml files in disk, not python object dumps, parse_ixbrl function is very slow for it will parsed xml to make python object(xbrl instance) again . I add parse_ixbrl_diskcache_version function, it uses diskcache to store the parse result in python object dump format. For load the python dump file is faster than get object from parsing xml. I recommend to use diskcache replacing HttpCache to cache parse results. In addition, diskcache hide the cache detail to let the user merely focus on parse xbrl file or url.