• Jasper Chapman-Black's avatar
    SuperSize: Construct file tree in WebAssembly · 6cff8689
    Jasper Chapman-Black authored
    This establishes the framework through which the WebAssembly-backed web
    worker will send tree updates to the viewer thread.
    
    Currently WebAssembly constructs a JSON object, writes it to a char* in
    heap memory, passes that pointer to JavaScript, which reads the string
    out of heap memory, parses it into a JS object, and frees the heap
    pointer. Since sending the JS object from the web worker to the viewer
    thread involves a serialization/deserialization, this is performing an
    extra serialization/deserialization, but because any given tree load is
    only loading a 1-deep view of the file tree, the performance hit is very
    small. This sacrifice lets us maintain a common web worker API between
    the wasm and non-wasm implementations.
    
    TODOs have been liberally sprinkled through the CL reflecting future
    functionality like node filtering, components, and type-based size
    breakdowns.
    
    Bug: 1011921
    Change-Id: I383ec97bf252657c8840d0e36cb99f52645116c9
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1873108Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
    Commit-Queue: Andrew Grieve <agrieve@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#709479}
    6cff8689
model.cc 523 Bytes