Can the 256KB file size limit be increased to 1MB? #425
Replies: 3 comments 3 replies
-
We have done some significant work on improving the Rust binary size, especially with shopify_functions 0.8.0. Let me know if you are still encountering issues with the file size limit in Rust. |
Beta Was this translation helpful? Give feedback.
-
I've been working with Tinygo and keeping things under 256kb is a real challenge. It would help a lot if this gets increased to 1024kb or even 512kb. I of course don't fully understand the architecture behind Shopify Functions internally, and the reasons for having these low limits, but I assume increasing this file size won't drastically decrease performance. Am I right? If that is the case I do advocate for a more developer friendly configuration, with usage also embracing (incl. documentation+examples) languages like TinyGo and Zig with more then just a small reference in the WASM part of the docs. The problem with this low limit and I see it also with comments above here, is that utilizing certain dependencies for serialization or other things, quickly add up a lot. For json encoding and decoding I now utilized an rudimentary custom method for dealing with this. But even utilizing the "fmt" package does add up. For tinygo my recommended built arguments at this time are: Which does reduce my simple function to 135kb and includes imports of "fmt" and "os", but I had to avoid using packages that are really helpful and development friendly, had to dive into tinygo build optimizations (disable scheduler, no-debug, ...), and I need to be cautious about adding any code and dependencies to it, since it might go beyond the limit very quickly. Next to this; I'm very surprised with the way Shopify is embracing Rust, while the natural users of Shopify are still often clients and developers not familiar with any complex compiled languages. I would advocate and advice having more documentation and support for alternatives like tinygo and zig, also because Go especially is a much easier language to utilize then Rust for most. |
Beta Was this translation helpful? Give feedback.
-
I use the site from Framer nd it is almost 1.6M,So i want use this site as the homepage but this encountered the hot error.Please help me |
Beta Was this translation helpful? Give feedback.
-
Hey Shopify Team,
Shopify Functions is fantastic, but, I've hit a roadblock that I believe is affecting not just me but several other developers out there.
The 256KB file size limit for Shopify Functions is a bit tight, especially when working with Rust.
Public apps often have to cover a wide variety of use cases and configurations. This presents a challenge, because if you have many configuration options, the
serde
crate will generate a TON of monomorphized code, which bloats the executable size.For example, see this previous discussion about the 11M instruction count limit. My TypeScript Function keeps hitting the instruction count limit, but the file size limit is preventing me from releasing a more efficient Rust version that executes fewer instructions.
My suggestion: how about boosting the file size limit to
1 MB
?This should give developers more breathing room to create robust Shopify Functions without constantly worrying about fitting into a tight space.
I understand the need for limitations, but the current constraints seem to hinder the potential of what Shopify Functions can achieve.
I'm curious to know if others in the community share similar experiences or if there are alternative suggestions.
Looking forward to your thoughts and hopefully an expanded file size limit soon. 🙌
Best,
Tobe
Beta Was this translation helpful? Give feedback.
All reactions