WASM binaries for meshoptimizer #321
-
I was curious about why the WebAssembly files in the JavaScript transcoders are encoded as base64 in the JS file? Is there any particular benefit or is it just for ease of distribution/integration? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's for ease of distribution as well as faster cold start - it removes a dependent web request. I should mention that based on how caching is implemented today in browsers I wouldn't recommend this for large binaries - it only works well here because the binaries are pretty small (<10KB). Also, important point - this isn't Base64 :) It's a special encoding optimized for compressibility of the final result. Base64 files are larger and compress much worse. See #141 and #73 (comment) |
Beta Was this translation helpful? Give feedback.
It's for ease of distribution as well as faster cold start - it removes a dependent web request. I should mention that based on how caching is implemented today in browsers I wouldn't recommend this for large binaries - it only works well here because the binaries are pretty small (<10KB).
Also, important point - this isn't Base64 :) It's a special encoding optimized for compressibility of the final result. Base64 files are larger and compress much worse. See #141 and #73 (comment)