-
Hi, I'm amazed at how well this performs with large multi-gigabyte local files. I'm trying to understand the code, specifically whether or not the entire ArrayBuffer is loaded when a file is drag/dropped in. It appears that only the HDF5 header is read -- just enough to populate the list of datasets in the file; and then a specific dataset is loaded into memory only when the user clicks on it. This makes sense! But in the code it very clearly in Perhaps I am I looking in the wrong place in the code? I'd love to know how this works because I am trying to integrate this with a specific use case, and our files are all far too big to load all at once. Thanks for any hints! And what a great tool, thank you for this gift. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Is this all encapsulated in the React "suspense-fetch" library? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hi @billyc, this has to do with the new Now of course, this all works also because the viewer (i.e. Hope it makes sense, let me know 😉 |
Beta Was this translation helpful? Give feedback.
-
@axelboc A-ha, there it is! I was searching through the master branch and did not find the LocalFileProvider. Thought I was going mad. I'll take a look, thanks so much! (edit: found it, it was there all along ✅ ) |
Beta Was this translation helpful? Give feedback.
Hi @billyc, this has to do with the new
H5WasmLocalFileProvider
(and corresponding API:local/h5wasm-local-file-api.ts
), which uses h5wasm inside a web worker together with the Emscripten WORKERFS virtual filesystem (instead of MEMFS filesystem). Contrary toH5WasmProvider
, this new provider accepts aFile
object from an HTML fileinput
and passes it on to the WORKERFS file system, so the file no longer has to be loaded into memory. Check out #1582 and #1604 for more info.Now of course, this all works also because the viewer (i.e.
@h5web/app
) requests data and metadata lazily from the data provider, as the user explores the file.react-suspense-fetch
is the library that enables us to do …