---
title: "Comment by Adan Potyondy on \"Parse untrusted files with WebAssembly modules that have zero imports\" | Hashnode"
description: "The overhead is real, because the modules take JSON in and return JSON out: the whole input is copied into linear memory, then parsed and serialized there. I ju"
url: "https://hashnode.com/posts/parse-untrusted-files-with-webassembly-modules-that-have-zero-imports/6b1090fb292425f497f4bea0/comment/6b118809a3f72706179ba386"
---

[Discussion](https://hashnode.com/posts/parse-untrusted-files-with-webassembly-modules-that-have-zero-imports/6b1090fb292425f497f4bea0)

Comment [Parse untrusted files with WebAssembly modules that have zero imports](https://hashnode.com/posts/parse-untrusted-files-with-webassembly-modules-that-have-zero-imports/6b1090fb292425f497f4bea0)

[Adan Potyondy](https://hashnode.com/@apotyondy)

[1d ago](https://hashnode.com/posts/parse-untrusted-files-with-webassembly-modules-that-have-zero-imports/6b1090fb292425f497f4bea0/comment/6b118809a3f72706179ba386)

The overhead is real, because the modules take JSON in and return JSON out: the whole input is copied into linear memory, then parsed and serialized there.

I just measured two of them in Node, with a fresh instance per call:

-   email-parser, 10 MB email with an attachment: about 72 MB of linear memory, or 92 MB if you return the attachment as base64
-   csv-cleaner, 10 MB CSV with short rows: about 227 MB, because every cell becomes a JSON value

It grew roughly in line with input size from 1 to 25 MB. Linear memory doesn't shrink, so I'd use a fresh instance per file and drop it afterward. For big CSVs, split the file into chunks first and repeat the header in each one.

These modules work best for documents and messages. For very large files, a streaming parser is the better tool.
