SwissDataScienceCenter / calamus

A JSON-LD Serialization Libary for Python
Apache License 2.0
29 stars 12 forks source link

fix: improve performance of calamus.utils import using deferred execution #67

Closed Panaetius closed 2 years ago

Panaetius commented 2 years ago

Related to https://github.com/SwissDataScienceCenter/renku-python/issues/2411

prepareQuery is super slow and takes almost 1 second by itself.

the other big waste of time is importing rdflib (~0.45s).

Also ran isort.

Before:

time python -c "import calamus.utils"

real    0m1.354s
user    0m1.297s
sys     0m0.057s

After:

$ time python -c "import calamus.utils"

real    0m0.062s
user    0m0.056s
sys     0m0.008s