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

[BUG] Performance improvement for non-uvicorn ASGI environments #620

Open
4 tasks done
ryansb opened this issue Jan 4, 2025 · 0 comments
Open
4 tasks done

[BUG] Performance improvement for non-uvicorn ASGI environments #620

ryansb opened this issue Jan 4, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@ryansb
Copy link
Contributor

ryansb commented Jan 4, 2025

Describe the bug

fasthtml/core.py file imports uvicorn even though it's only used for serve() calls. For AWS Lambda this causes worse cold starts than if the uvicorn was imported inline of serve().

Minimal Reproducible Example

# Your code here
from fasthtml.core import *
uvicorn # uvicorn is imported and re-exported, even though it's only used in `serve()`

Expected behavior

I'd expect that users of other ASGI serving methods would not need to load uvicorn at runtime unless they are using it.

Environment Information
Please provide the following version information:

  • fastlite version: 0.1.1
  • fastcore version: 1.7.28
  • fasthtml version: 0.10.3

Confirmation
Please confirm the following:

  • I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
  • I have provided a minimal reproducible example
  • I have included the versions of fastlite, fastcore, and fasthtml
  • I understand that this is a volunteer open source project with no commercial support.

Additional context
Add any other context about the problem here.

Screenshots
If applicable, add screenshots to help explain your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant