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
PalettedBlockArray: allow getting and providing palette as raw bytes, instead of an array
closes#36
This is significantly faster, particularly in the 16 bpb case, which
shows a combined performance improvement of 24500 ns -> 1700 ns for
recreating a paletted array using a string instead of an array.
We really were paying a hilariously large performance penalty for
processing these as an array, even just within the extension itself.
Not to mention the cost of needing to use pack() and unpack() in
"Fast"ChunkSerializer...
if ((ZSTR_LEN(paletteZstr) % sizeof(Block)) != 0) {
57
+
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0, "palette length in bytes must be a multiple of %zu, but have %zu bytes", sizeof(Block), ZSTR_LEN(paletteZstr));
58
+
returnfalse;
59
+
}
60
+
61
+
auto paletteEntries = ZSTR_LEN(paletteZstr) / sizeof(Block);
0 commit comments