You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
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.
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.
Activity
pushfoo commentedon 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 commentedon 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 commentedon Oct 10, 2024
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 commentedon Oct 10, 2024
I thought we stopped, but do we still load the Kenny fonts by default?
Yep, that's pyglet. They also do some interesting things like having
Windowchange per-platform.Adding comments in relation to #2402
einarf commentedon Oct 25, 2024
I put this past 3.0 for now. It's high pri for later.
DigiDuncan commentedon Nov 4, 2024
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.
einarf commentedon Feb 2, 2025
Import time on windows with my current project(s)
We can probably get this down below a second with lazy imports but it will still be a problem for projects with text and controller input.
pvcraven commentedon Oct 9, 2026
Closing this. Both parts are done for 4.0:
Import time (#2964):
import arcadewent from about 2.7 to 0.9 seconds on Windows.pyglet.inputis imported. Arcade's controller functions now import it on first use.Top-level names (#2965): we went through all 169 names in
arcade.__all__and removed the ones that were outdated, duplicated or wrong:AnimatedWalkingSprite(already documented as deprecated) and theFACE_*constants only it usedget_game_controllers(), a duplicate ofget_joysticks()whose name suggested it returned game controllersdraw_lrbt_rectangle_filled/draw_lrbt_rectangle_outlineentries in__all__We kept some on purpose:
set_background_colorandMOUSE_BUTTON_*. They overlap newer APIs, but they're beginner-friendly and used in examples and docs.start_render/finish_renderand the timing functions, which are still current.ArcadeContextandDefaultTextureAtlas, which are documented and used.