Closed wch closed 1 year ago
One possibility would be boost::unordered_map
. Brings in the hefty BH
dependency, though. If you go for including a fast hash map implementation (like now tsl::hopscotch_map
), it would be great if you could place it in inst/include
. This would allow other packages to make use of it, too.
Yeah, I don't want to bring in BH as a dependency. It's important for this package to be lightweight. Also, as far as I know, there's no guarantee that boost::unordered_map
is consistent across platforms.
As for putting the headers in inst/
, I don't want to do that for reasons explained here: https://github.com/r-lib/fastmap/pull/9#issuecomment-498730852
See https://github.com/r-lib/fastmap/issues/8#issuecomment-497942394. The idea is that the order from
$keys()
and$as_list()
doesn't have to be sorted in any particular fashion; it just should be consistent across platforms so that users aren't surprised when behavior isn't reproducible when moving code from one platform to another.