On Fri, Jul 5, 2019 at 8:21 PM Stefan Monnier wrote: > >> His patch can/should be made slightly more efficient by only doing the > >> Fcopy_sequence on those hash-tables that are in purespace. > > > > How do we test for that? > > With PURE_P? That only works before we dump, I think? > > I'm not sure how difficult it would be, but we could dump the ->index, > > ->next, ->hash vectors as Qnil (so not include the actual vectors in > > the dump), which would make the dump slightly smaller and give us a > > better test than h->count < 0: > > Except that it can't be done at the time of purecopy but only at the > time we do the actual dump because the purecopied hashtable may be used > in-between (which is also why count is kept positive by purecopy and is > only made negative later). Indeed. I'm attaching a proof of concept that we can simply freeze the hash tables when dumping and thaw them when loading a dump, which includes rehashing. Do you happen to know why it wasn't done that way? I quite enjoyed removing all the scattered hash_rehash_if_needed()s.