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

lazy-load expensive beatmap attributes to show a UI sooner #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tybug
Copy link
Contributor

@tybug tybug commented Apr 16, 2021

what matters most to users is that a screen is shown as soon as possible after they click "visualize". This is an attempt to make that process faster by not loading a beatmap's hitobjects (and other attributes that rely on the hitobjects) in the initial rendering of the ui, and load them in a separate thread instead (the completion of which we wait for before actually visualizing anything, which was easy to do, since we already have that logic for the existing process_sliders thread).

What I have here does work with no issues, which is why I'm pring it. The thing is, this adds a fair bit of complexity to the code and I'm not sure the speedup is all that significant (though it's a damn hard thing to test). I think I'm not going to merge this for now, but may change my mind in the future.

Note to future self: loading the beatmap itself (not even its hitobjs) from slider is likely to be expensive and should also be given the same lazy-load treatment for best results. Specifically this code:

        if beatmap_info.path:
            self.beatmap = Beatmap.from_path(beatmap_info.path)
        elif beatmap_info.map_id:
            # TODO move temporary directory creation to slider probably, since
            # this logic is now duplicated here and in circlecore
            self.beatmap = self.library.lookup_by_id(beatmap_info.map_id, download=True, save=True)

@tybug tybug changed the title lazy-load expensive beatmap attributes to show a UI ASAP lazy-load expensive beatmap attributes to show a UI sooner May 21, 2021
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.

1 participant