用absl::flat_hash_*直接替换std::unordered_*没有啥坑吧
std::unordered_set
$ ../test10
timer: 5273 ms
$ valgrind ../test10
==167442== Memcheck, a memory error detector
==167442== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==167442== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==167442== Command: ../test10
==167442==
timer: 77609 ms
==167442==
==167442== HEAP SUMMARY:
==167442== in use at exit: 0 bytes in 0 blocks
==167442== total heap usage: 43,323,376 allocs, 43,323,376 frees, 2,686,133,892 bytes allocated
==167442==
==167442== All heap blocks were freed -- no leaks are possible
==167442==
==167442== For lists of detected and suppressed errors, rerun with: -s
==167442== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
absl::flat_hash_set
$ ../test10
timer: 3828 ms
$ valgrind ../test10
==167292== Memcheck, a memory error detector
==167292== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==167292== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==167292== Command: ../test10
==167292==
timer: 41371 ms
==167292==
==167292== HEAP SUMMARY:
==167292== in use at exit: 0 bytes in 0 blocks
==167292== total heap usage: 68,164 allocs, 68,164 frees, 1,349,854,948 bytes allocated
==167292==
==167292== All heap blocks were freed -- no leaks are possible
==167292==
==167292== For lists of detected and suppressed errors, rerun with: -s
==167292== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--
FROM 68.197.87.*