Right now we need to copy each item from tax_ids into the HashMap as a key (to avoid making the struct self-referential) for its lookup, but if we didn't have to do this we'd save some memory.
Options:
- Make
tax_id_lookup self-referential somehow. There are a couple libraries to allow things like this, but the ones I looked at are questionably sound
- Make
tax_id_lookup a HashMap<hash, IntTaxId> and handle all the hashing and collision detection ourselves (reinvent a lot of the HashMap). This may be similar to the NoHashHasher in finch with an additional collision check.
Right now we need to copy each item from
tax_idsinto the HashMap as a key (to avoid making the struct self-referential) for its lookup, but if we didn't have to do this we'd save some memory.Options:
tax_id_lookupself-referential somehow. There are a couple libraries to allow things like this, but the ones I looked at are questionably soundtax_id_lookupaHashMap<hash, IntTaxId>and handle all the hashing and collision detection ourselves (reinvent a lot of theHashMap). This may be similar to theNoHashHasherinfinchwith an additional collision check.