You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suppose I want to store 80,000 pre-blurred images in my database. LjIY5?00?bIUofWBWBM{WBofWBj[ is a sample 4×3 blurHash, and is 28 bytes (224 bits) long. Suppose I use a fixed-width data type in my database, so I don't need the first character of the string which encodes the length. If we remove the first character and encode the same blurHash in its equivalent raw bytes, we need only ~10 bytes (73 bits) to encode the hash, saving 1.5 MB on disk for 80,000 images. That may seem like a micro-optimization, especially in an RDBMS which may duplicate data in indexes. You could say I'm just allergic to plaintext formats when a more compact representation would do, and you'd be right :) I still think there's value in this approach though.
The text was updated successfully, but these errors were encountered:
There definitely is merit in this: base83 is imposing the (severe) limitations of JSON binary encoding onto the user of the library, when the user of the library might be perfectly capable of representing binary data as binary data (as in the OP's case). Helpers for JSON/HTML compatibility are fine, but right now they are forced on everyone rather than only being forced on people who are themselves forced to deal with JSON's limitations.
Suppose I want to store 80,000 pre-blurred images in my database.
LjIY5?00?bIUofWBWBM{WBofWBj[
is a sample 4×3 blurHash, and is 28 bytes (224 bits) long. Suppose I use a fixed-width data type in my database, so I don't need the first character of the string which encodes the length. If we remove the first character and encode the same blurHash in its equivalent raw bytes, we need only ~10 bytes (73 bits) to encode the hash, saving 1.5 MB on disk for 80,000 images. That may seem like a micro-optimization, especially in an RDBMS which may duplicate data in indexes. You could say I'm just allergic to plaintext formats when a more compact representation would do, and you'd be right :) I still think there's value in this approach though.The text was updated successfully, but these errors were encountered: