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

Readd cache #441

Closed
wants to merge 1 commit into from
Closed

Readd cache #441

wants to merge 1 commit into from

Conversation

ThanatosGit
Copy link
Collaborator

Ok, I lied in the other PR. I just looked into the code. We return a generator via yield in the function.
It's a pretty bad idea to use a cache on a generator because it will return the same generator multiple times but we iterate through it, so the generator is already exhausted after first loop.
Or short: This code is only executed once and not for all required scenarios.

    for asset in editor.get_asset_names_in_folder("actors/props/systemmechdna"):
        editor.ensure_present_in_scenario(scenario_name, asset)

I switched to return a list instead.
Should have seen this when I initially reviewed it. Stupid me, sorry. :(

But better to not include for the next release.

Fix #435

@ThanatosGit ThanatosGit requested a review from dyceron July 29, 2024 20:27
@Miepee
Copy link
Contributor

Miepee commented Jul 29, 2024

Can you show the performance change between main / this branch?

@dyceron
Copy link
Collaborator

dyceron commented Aug 11, 2024

Hmm, my testing shows it to be about the same?

@ThanatosGit
Copy link
Collaborator Author

Ok

@ThanatosGit ThanatosGit deleted the cache-again branch August 11, 2024 04:34
@dyceron
Copy link
Collaborator

dyceron commented Aug 11, 2024

I didn't mean for you to close this. I was hoping you would test this to confirm.

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.

Caching get_asset_names_in_folder causes custom DNA Chozo Seals to not fully load
3 participants