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

projects with many image assets initially load with question marks #8403

Closed
benjiwheeler opened this issue Jul 8, 2022 · 2 comments
Closed

Comments

@benjiwheeler
Copy link
Contributor

benjiwheeler commented Jul 8, 2022

Expected Behavior

  1. load a project with a high number of images, such as https://scratch.mit.edu/projects/697304342/
  2. click the green flag
  3. see the costumes normally
  4. project runs at normal speed

image

Actual Behavior

  1. some costumes appear as question marks
  2. project runs incredibly slowly

image

System Details

Unclear if this is system/browser dependent; I'm using an M1 mac running chrome 103

Discussion

One of our devs said "I'm not sure why it happens. It seems to be related to loading MANY assets. Often, if you reload the project it'll load more of the assets successfully (I assume the browser cache is helping) and after an iteration or two it might get to 100%."

I tried loading https://scratch.mit.edu/projects/697304342/, and it loaded with many question marks and ran incredibly slowly -- like 1/20th its intended speed. I then tried reloading it twice more, and on the third load, everything seemed to finally load completely, and the project ran fast.

Notably, the project works fine on the first load with Turbowarp: https://turbowarp.org/697304342 -- perhaps we should ask them what they're doing differently?

One possibility: we might be hitting a limit for parallel web requests. We don't currently do anything to throttle asset requests -- the editor throws every asset request to scratch-storage, and scratch-storage makes a fetch request immediately. We rely on the browser to schedule (throttle) these requests.

In scratch-desktop, where those are actually file loads instead of web requests, that ends up destroying performance in some cases, like the asset library display. We had to add throttling in that case, but that throttling implementation is specific to the asset libraries.

Maybe moving that throttling into scratch-storage would help with performance and possibly fix this ERR_INSUFFICIENT_RESOURCES thing. It would also be a step toward merging the different branches of scratch-gui, which is another long-term goal of ours.

@benjiwheeler benjiwheeler changed the title projects with many image assets initially load with question marks CE-132 projects with many image assets initially load with question marks Jul 8, 2022
@apple502j
Copy link
Contributor

apple502j commented Jul 8, 2022

Duplicate of #5844, #7111 (behavior probably changed with recent VM/storage fixes)

@benjiwheeler benjiwheeler changed the title CE-132 projects with many image assets initially load with question marks projects with many image assets initially load with question marks Jul 10, 2022
@benjiwheeler
Copy link
Contributor Author

Closing per #7111

@benjiwheeler benjiwheeler reopened this Jul 10, 2022
@benjiwheeler benjiwheeler closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants