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

Speed up Flash #101

Open
4 of 8 tasks
incognitojam opened this issue Feb 18, 2025 · 0 comments
Open
4 of 8 tasks

Speed up Flash #101

incognitojam opened this issue Feb 18, 2025 · 0 comments

Comments

@incognitojam
Copy link
Member

incognitojam commented Feb 18, 2025

  • The download of images from Azure is slow - takes about 2.5 min for 900MB system image (today 4.5m...)
  • download/unpack in parallel (if both download and unpack take 4m, we have saved 4m)
  • replace js-sha with hash-wasm (unpack 10m -> 4m)
    • updating the sha256 hash for each chunk during unpack is slow - seems to take 6ms for every chunk
  • xz-decompress is slow
  • There may be overhead because for the XZ decompression and SHA calculation we transfer bytes from JS to WASM (and back for decompression)... Not sure yet how complex it is to write something to process everything on the WASM side.
  • Moving the QdlManager to a web worker (instead of just ImageWorker) may also help speed things up as it would move the flashing (which includes computations like Sparse.splitBlob) off of the main/render thread
  • Faster flashing of sparse images in qdl.js (flashing from 2:30 to 1:50)
    • fast erase partition/sector
    • skip chunks during flashing
  • Stream images to flash while downloading (qdl.js needs to accept a ReadableStream for blob to flash)

You can generate perf traces in Chrome in the performance tab

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