ekiwi / fst-reader

Native Rust implementation of the FST waveform format from GTKWave.
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

Use an io::Cursor instead of tempfile #4

Closed TheZoq2 closed 1 month ago

TheZoq2 commented 2 months ago

Fixes https://github.com/ekiwi/wellen/issues/25 though presumably this has some RAM usage consequences.

I briefly attempted a #[cfg(target_arch=wasm)-specific fix to not change too much, but that would require #[cfg]-ing the output of uncompress_gzip_wrapper which becomes annoying

I also tried making the return type be impl Read+Seek but that requires adding generic arguments in more places.

For now without knowing the performance implications of this, I think it is the best solution

ekiwi commented 2 months ago

Thanks for this PR. I would prefer a solution where a temp file is used when available, and we fall back to a Vec otherwise. I can try to implement that myself. Just give me a couple of days.

TheZoq2 commented 2 months ago

Sounds good!

ekiwi commented 1 month ago

This should hopefully fix the wasm issue: https://gitlab.com/surfer-project/surfer/-/merge_requests/486

This is the change I made: https://github.com/ekiwi/fst-native/commit/e43210fb8829d987c9dc28113c25167584beaa1f