Skip to content

Instantly share code, notes, and snippets.

@patrickfav
Last active February 26, 2023 18:41
Show Gist options
  • Save patrickfav/34832a9d1724fc1ba948ffb9b6920160 to your computer and use it in GitHub Desktop.
Save patrickfav/34832a9d1724fc1ba948ffb9b6920160 to your computer and use it in GitHub Desktop.
Statistics for required space for encoded vs. compressed.
## Random Data
Original size: 1024 byte
Compressed size (raw): 1047 byte
Name enc diff % enc-comp diff
------------------------------------------------------------------
base85 1280 256 23% 1076 29 2%
base64 1366 342 31% 1073 26 2%
base36 1585 561 51% 1082 35 3%
base32 1639 615 56% 1081 34 3%
base26 1743 719 65% 1101 54 4%
base16 2048 1024 88% 1160 113 9%
dec 2466 1442 113% 1265 218 17%
octal 2731 1707 130% 1305 258 19%
binary 9215 8191 427% 1914 867 45%
Best 3 results for encoded:
[base85]
Encoded size: 1280 byte (256 byte [+20%])
Compressed size (enc): 1076 byte (29 byte [+2%])
[base64]
Encoded size: 1366 byte (342 byte [+25%])
Compressed size (enc): 1073 byte (26 byte [+2%])
[base36]
Encoded size: 1585 byte (561 byte [+35%])
Compressed size (enc): 1082 byte (35 byte [+3%])
Best 3 results for encoded & compressed:
[base64]
Encoded size: 1366 byte (342 byte [+25%])
Compressed size (enc): 1073 byte (26 byte [+2%])
[base85]
Encoded size: 1280 byte (256 byte [+20%])
Compressed size (enc): 1076 byte (29 byte [+2%])
[base32]
Encoded size: 1639 byte (615 byte [+37%])
Compressed size (enc): 1081 byte (34 byte [+3%])
**********************************************
Original size: 131072 byte
Compressed size (raw): 131130 byte
Name enc diff % enc-comp diff
------------------------------------------------------------------
base85 163840 32768 24% 133095 1965 1%
base64 174763 43691 32% 132409 1279 0%
base36 202821 71749 52% 137206 6076 4%
base32 209716 78644 56% 138651 7521 5%
base26 223079 92007 64% 141710 10580 7%
base16 262144 131072 87% 149781 18651 12%
dec 315651 184579 123% 149443 18313 12%
octal 349523 218451 145% 149869 18739 12%
binary 1179647 1048575 455% 230339 99209 43%
Best 3 results for encoded:
[base85]
Encoded size: 163840 byte (32768 byte [+20%])
Compressed size (enc): 133095 byte (1965 byte [+1%])
[base64]
Encoded size: 174763 byte (43691 byte [+25%])
Compressed size (enc): 132409 byte (1279 byte [+0%])
[base36]
Encoded size: 202821 byte (71749 byte [+35%])
Compressed size (enc): 137206 byte (6076 byte [+4%])
Best 3 results for encoded & compressed:
[base64]
Encoded size: 174763 byte (43691 byte [+25%])
Compressed size (enc): 132409 byte (1279 byte [+0%])
[base85]
Encoded size: 163840 byte (32768 byte [+20%])
Compressed size (enc): 133095 byte (1965 byte [+1%])
[base36]
Encoded size: 202821 byte (71749 byte [+35%])
Compressed size (enc): 137206 byte (6076 byte [+4%])
## Text (Logs)
Original size: 909068 byte
Compressed size (raw): 53057 byte
Name enc diff % enc-comp diff
------------------------------------------------------------------
base85 1136335 227267 159% 142667 89640 62%
base64 1212091 303023 278% 108906 55879 51%
base36 1406702 497634 52% 952043 899016 94%
base32 1454509 545441 364% 149634 96607 64%
base26 1547205 638137 64% 983477 930450 94%
base16 1818136 909068 1150% 79046 26019 32%
dec 2189253 1280185 124% 1028379 975352 94%
octal 2424180 1515112 963% 157177 104150 66%
binary 8181611 7272543 1643% 442539 389512 88%
Best 3 results for encoded:
[base85]
Encoded size: 1136335 byte (227267 byte [+20%])
Compressed size (enc): 142667 byte (89640 byte [+62%])
[base64]
Encoded size: 1212091 byte (303023 byte [+25%])
Compressed size (enc): 108906 byte (55879 byte [+51%])
[base36]
Encoded size: 1406702 byte (497634 byte [+35%])
Compressed size (enc): 952043 byte (899016 byte [+94%])
Best 3 results for encoded & compressed:
[base16]
Encoded size: 1818136 byte (909068 byte [+50%])
Compressed size (enc): 79046 byte (26019 byte [+32%])
[base64]
Encoded size: 1212091 byte (303023 byte [+25%])
Compressed size (enc): 108906 byte (55879 byte [+51%])
[base85]
Encoded size: 1136335 byte (227267 byte [+20%])
Compressed size (enc): 142667 byte (89640 byte [+62%])
## Image
Original size: 43224 byte
Compressed size (raw): 31895 byte
Name enc diff % enc-comp diff
------------------------------------------------------------------
base85 54030 10806 25% 42165 10286 24%
base64 57632 14408 35% 40198 8319 20%
base36 66885 23661 52% 45189 13310 29%
base32 69159 25935 60% 43098 11219 26%
base26 73566 30342 65% 46640 14761 31%
base16 86448 43224 108% 39695 7816 19%
dec 104094 60870 121% 50150 18271 36%
octal 115264 72040 159% 45116 13237 29%
binary 389015 345791 584% 59176 27297 46%
Best 3 results for encoded:
[base85]
Encoded size: 54030 byte (10806 byte [+20%])
Compressed size (enc): 42165 byte (10286 byte [+24%])
[base64]
Encoded size: 57632 byte (14408 byte [+25%])
Compressed size (enc): 40198 byte (8319 byte [+20%])
[base36]
Encoded size: 66885 byte (23661 byte [+35%])
Compressed size (enc): 45189 byte (13310 byte [+29%])
Best 3 results for encoded & compressed:
[base16]
Encoded size: 86448 byte (43224 byte [+50%])
Compressed size (enc): 39695 byte (7816 byte [+19%])
[base64]
Encoded size: 57632 byte (14408 byte [+25%])
Compressed size (enc): 40198 byte (8319 byte [+20%])
[base85]
Encoded size: 54030 byte (10806 byte [+20%])
Compressed size (enc): 42165 byte (10286 byte [+24%])
@patrickfav
Copy link
Author

Uses compression benchmark from: https://github.com/patrickfav/dice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment