Skip to content

Why does WrightTools take so long to import?  #1083

@darienmorrow

Description

@darienmorrow

I have noticed whenever I am working, when I add a WrightTools import to my script, it takes a ~second longer to run. Running the below code a bunch of times, I see numpy routinely takes 0 ms to import, scipy takes 20-200 ms, and WrightTools takes 1-5 s.

  1. Has anyone else noticed this?
  2. If so, do we understand why this is?
import time
t0 = time.time()
import numpy as np
t1 = time.time()
import scipy as sp
t2 = time.time()
import WrightTools as wt
t3 = time.time()
print('numpy', round(t1-t0, 4))
print('scipy', round(t2-t1, 4))
print('wrighttools', round(t3-t2, 4))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions