Skip to content

Conversation

hallacy
Copy link
Collaborator

@hallacy hallacy commented Apr 7, 2023

Removes pandas (no resource uses it) and fixes aiohttp importing as suggested in #380.

I think this gets us from ~5 seconds to 2.5 seconds:
Screenshot 2023-04-07 at 2 30 49 PM

Copy link

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

re: #380 (comment)
I think fine to split up the helpers. If you end up needing to do something more general, could use a nice module __getattr__:

# lazy.py
def __getattr__(name):
    if name == "np":
        import numpy  # TODO: raise the nice MissingDependencyError
        globals()["np"] = numpy
        return numpy
    ...

and then use lazy.np everywhere you'd use np.

@hallacy hallacy merged commit bd269ab into main Apr 8, 2023
@hallacy hallacy deleted the dev/hallacy/speed_up_imports branch April 8, 2023 00:53
@elanzini
Copy link

@hallacy Was curious about what tool you used to get the visualization above.

@hauntsaninja
Copy link

Looks like tuna? I've seen some accuracy issues using tuna, I recommend one of these two: #380 (comment)

@elanzini
Copy link

Looks like tuna? I've seen some accuracy issues using tuna, I recommend one of these two: #380 (comment)

Thanks @hauntsaninja. From the README of tuna it sounds like it's also compatible with importtime, you just save the log locally and parse it with tuna.

davedittrich pushed a commit to davedittrich/openai-python that referenced this pull request Nov 14, 2023
cgayapr pushed a commit to cgayapr/openai-python that referenced this pull request Dec 14, 2024
stainless-app bot pushed a commit that referenced this pull request Mar 27, 2025
…-changes--next--components--openai

release: 4.12.4
safa0 pushed a commit to safa0/openai-agents-python that referenced this pull request Apr 27, 2025
Slot had inconsistent name. 

`"first_byte_at"` -> `"first_content_at"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants