Disclaimer: Not knowning anything about anything...
I wonder if `Hashtbl.randomize` would help here?
This behavior reminds me of an "accidentally quadratic" issue that rust had when resizing hash tables.
Hashtbl is implemented on top of Array, which is itself largely implemented in C. Up until 4.04.0, Hashtbl was an array of primitives and copying one was as simple as copying the array (which is probably just a bit of C for allocating and copying memory). After that, the implementation of Hashtbl was changed to be an array of records, and to copy it, you need to walk the array and copy each record, in addition to copying the array structure itself. The latter implementation is simply more work.