biopragmatics / bioontologies

🏷️ Unified access to biomedical ontologies
https://bioontologies.readthedocs.io
MIT License
8 stars 1 forks source link

Performance: Loading from `robot` modules taking ~24 seconds #7

Open joeflack4 opened 1 year ago

joeflack4 commented 1 year ago

Overview

I just started using this package to convert OWL to Obographs. So far it is working great! The only issue I experience so far is very slow load time when importing the robot module. It's not even that I'm using the module in any way; just importing it:

t0 = datetime.now()
from bioontologies.robot import ParseResults, convert_to_obograph_local
t1 = datetime.now()
print(f'Loaded bioontologies in {(t1 - t0).seconds} seconds')

Loaded bioontologies in 24 seconds

Additional info

This happened whether or not I did from bioontologies.robot import ParseResults, convert_to_obograph_local or from bioontologies import robot.

cthoyt commented 1 year ago

There are a few things that get loaded to support Bioregistry standardization that can be made more lazy in case they're not used, I'm actually working on improving some of the underlying code in the Bioregistry in https://github.com/biopragmatics/bioregistry/pull/631 right now

joeflack4 commented 1 year ago

Sounds like a good plan to me!