Skip to content
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

'import pkg_resources' is slow and impacts cold starts #305

Closed
prestomation opened this issue Jun 15, 2021 · 5 comments · Fixed by #306
Closed

'import pkg_resources' is slow and impacts cold starts #305

prestomation opened this issue Jun 15, 2021 · 5 comments · Fixed by #306
Assignees
Labels

Comments

@prestomation
Copy link

There are two locations in the code base that use from pkg_resources import resource_filename to get the location of some packaged, static json data.

During some profiling of a ~1.5gb python3.8 lambda function, I discovered that this import alone takes on the order of 250ms and is one of the larger single contributors of cold start in my sample function.

Could we consider some other method for consuming this data?

@NathanielRN
Copy link
Contributor

Thanks for bringing this to our attention, @prestomation !

I was able to reproduce the slow behavior of resource_filename and found a solution online to make the loading faster. We just merged #306 in hopes of improving the performance, which should go out in the next release.

Let me know if you have any additional questions or comments!

@heitorlessa
Copy link

Hey @NathanielRN do we have some rough dates on when the next release will be out?

It's been a couple of months since the last release. It'd be awesome to have this Perf improvement out for customers

@NathanielRN NathanielRN linked a pull request Nov 30, 2021 that will close this issue
@NathanielRN
Copy link
Contributor

Thanks for the prompt @heitorlessa ! I'll message the team and see if they can cut us a release soon.

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs in next 7 days. Thank you for your contributions.

@stale stale bot added the stale label Jan 8, 2022
@NathanielRN
Copy link
Contributor

This should have been released in be4dea2 as version 2.9.0. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants