-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How small can I get this? #16
Comments
I'm not aware of any easy wins. What might make a difference is telling the compiler to optimize for size, but I don't know how well that is supported for WASM and it's quite some work to get that into the whole build process including all the libraries. |
For this since its all in existing hardware, how come you need to use wasm and web vs directly compiling OpenSCAD for the platform? Wouldn't you be able to achieve much better performance and size characteristics? |
OpenSCAD doesn't need to, and can't, run on the hardware (it's a 50 cent microcontroller), but the hardware does generate SCAD data, and enumerates itself as a USB mass storage device. |
I see. Sorry I assumed the device needed to run it not just serve it. I guess you could try building your own version with a different set of compiler flags to try and squeeze a bit out. I'm assuming that you are using a fixed .scad file so you could even go so far as try to strip out features that your file does not use and rebuild the wasm. |
Hopefully should be reasonable simple to answer -
I'm trying to build a proof-of-concept hardware demo that implements a mass storage device with a portable OpenSCAD compiler. No UI, fonts, etc., are required, just a single .HTML file where you open it, click a button, and it spits out an STL from a hardcoded SCAD model. Since I'm not assuming the presence of a web server, I can't fetch OpenSCAD from a CDN because of CORS policy, and anyway I want it to work offline.
My target for the entire package is 2 megabytes, as that's the size of the NOR flash I built the hardware with.
I see that openscad.wasm can LZMA compress down to 1.7 MBytes, and I imagine there's some way to unpack that blob on page load. So it all seems possible. But I'd like a bit more headroom.
What are the build-time flags I should be switching off to get the size down even further?
The text was updated successfully, but these errors were encountered: