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

Reconsider and evaluate top-level imports #2402

Open
DigiDuncan opened this issue Oct 9, 2024 · 6 comments
Open

Reconsider and evaluate top-level imports #2402

DigiDuncan opened this issue Oct 9, 2024 · 6 comments
Milestone

Comments

@DigiDuncan
Copy link
Collaborator

Leaving this here so we don't forget it. We need to take a quick lookover on what should be a top-level import, both for clarity, and to possibly reduce build size when arcade is imported.

@pushfoo pushfoo added this to the 3.0 mandatory milestone Oct 9, 2024
@pushfoo
Copy link
Member

pushfoo commented Oct 9, 2024

I'm marking the evaluation of top-level imports as 3.0 mandatory since it's a commitment we have to keep to. Build size / packaging should be a separate issue.

@einarf
Copy link
Member

einarf commented Oct 10, 2024

I suspect input and media is adding a ~5 second startup time for me on my new laptop. Possibly also text. We have talked about this many times but I'm not sure if there is a clean solution. The rest of the imports I don't think cause any issues.

@cspotcode
Copy link
Collaborator

Some python libraries use tricks so that imports load on-demand, completely seamless from the consumer perspective. So if you never access a heavyweight component, it never imports.

@pushfoo
Copy link
Member

pushfoo commented Oct 10, 2024

Possibly also text. We have talked about this many times but I'm not sure if there is a clean solution.

I thought we stopped, but do we still load the Kenny fonts by default?

Some python libraries use tricks so that imports load on-demand, completely seamless from the consumer perspective. So if you never access a heavyweight component, it never imports.

Yep, that's pyglet. They also do some interesting things like having Window change per-platform.

DragonMoffon added a commit that referenced this issue Oct 11, 2024
This is super onionated, but we should make a start
@einarf einarf modified the milestones: 3.0 mandatory, 3.0.x Oct 23, 2024
@einarf
Copy link
Member

einarf commented Oct 25, 2024

I put this past 3.0 for now. It's high pri for later.

@DigiDuncan
Copy link
Collaborator Author

I think this should be in 3.0 mandatory, personally. Given that we're waiting on Pyglet 2.1 anyway, taking a day to do this while we can seems important. It can't reasonably be 3.0.x, since it'd be a breaking API change, so we'd have to wait until 3.1, and I'd rather not.

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

No branches or pull requests

4 participants