Skip to content

Speed up Flash #101

@incognitojam

Description

@incognitojam
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions