Meshes with millions of vertices could freeze when storing
edit-mode undo steps. This occurred when de-duplicating boolean arrays
(typically selection & hidden data).
This problem occurred after v3.3 because vert/edge/face flags were
moved into their own boolean custom-data layers.
Resolve using run-length encoding, used to encode all boolean
custom-data layers before adding them to the BArrayStore.
The overall speedup depends on the order of elements in the mesh
as well as the previous state of the mesh used for comparison.
Testing box selection with subdivided cubes (3.9 million vertices)
shows a speedup from an around between 8..16 seconds to ~0.025 seconds.
Even though this ran in a background thread, adding undo steps
waits for the previous step to finish which could freeze.
Tweaks to BLI_array_store such as increasing the block-size used by
edit-mesh undo and increasing length of hashed data helped but didn't
resolve the issue, see: !138975.
See code-comments for details.