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

Slow FilePicker performance due to large amounts of assets/icons in single folder #185

Open
rikmarais opened this issue Feb 10, 2023 · 0 comments

Comments

@rikmarais
Copy link

rikmarais commented Feb 10, 2023

Describe the bug
FilePicker.browse when changing a default icon, e.g. systems/zweihander/assets/icons/character.svg needs to browse 4172 icons in systems/zweihander/assets/icons, leading to significant and unnecessary delay.

There are 4172 icons in the systems/zweihander/assets/icons directory. On a local machine, this isn't very noticeable, but still leads to a delay of ~0.5 seconds to browse, before rendering the FilePicker.

However when your assets are hosted on a network drive instead of on the local disk, (e.g. the Forge's Assets Library), this browse on the populated directory can lead to a significant delay (on the scale of 5-10s). I imagine that this would happen when using any network drive, even S3 storage.

Proposed solution
Not all of the 4172 icons in systems/zweihander/assets/icons/ are in use by default.
Moving/duplicating the default icons that are in use for each actor type and each item type, at least, to a separate systems/zweihander/assets/icons/default folder will drastically increase FilePicker.browse's performance, on network drives and also local drives, leading to a smoother experience while still allowing navigation into the more populated folder if a different icon is needed.

Alternatively, organizing the icons in systems/zweihander/assets/icons/ by type/purpose/intent will also improve performance. Eg. conditions, creatures, effects, spells, items, etc.

To Reproduce
Steps to reproduce the behavior:

  1. Blank world, new actor
  2. Click actor portrait image to assign new image
  3. Wait for FilePicker.browse to complete. Takes ~0.5s on local drive and significantly longer on a network drive.

Expected behavior
After a short browse, render FilePicker.

Screenshots
image

Additional context
While this might only strongly negatively affect user who are using network drives, it causes a non-zero delay on local drives as well, and would likely be more noticeable on slower drives like HDDs.

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

1 participant