Using XXHash64 for all wcstring unordered_map/set hashing

Since we are including XXHash32/64 anyway for the wchar_t* hashing,
we might as well use it.

Use arch-specific hash size and xxhash for all wcstring hashing

Instead of using XXHash64 for all platforms, use the 32-bit version
when running on 32-bit platforms where XXHash64 is significantly slower
than XXHash32 (and the additional precision will not be used).

Additionally, manually specify wcstring_hash as hashing method for
non-const wcstring unordered_set/map instances (the const varieties
don't have an in-library hash and so already use our xxhash-based
specialization when calling std::hash<const wcstring>).
This commit is contained in:
Mahmoud Al-Qudsi
2017-08-19 13:47:16 -05:00
parent d9f901f36d
commit d54fbddb11
14 changed files with 35 additions and 34 deletions

View File

@@ -66,7 +66,7 @@ class argparse_cmd_opts_t {
wcstring_list_t raw_exclusive_flags;
wcstring_list_t argv;
std::unordered_map<wchar_t, option_spec_t *> options;
std::unordered_map<wcstring, wchar_t> long_to_short_flag;
std::unordered_map<wcstring, wchar_t, wcstring_hash> long_to_short_flag;
std::vector<std::vector<wchar_t>> exclusive_flag_sets;
~argparse_cmd_opts_t() {