Switch `std::string` -> hashes for label resolution. (#2215)
Use the simple but well-known FNV-1a hash function to map `cell_tag_type` aka `std::string` to an `uint64_t` for label resolution. The former type has a size of 32B or more and the latter 8B, thus cutting the storage and bandwidth requirements by 3/4. The hash function is implemented from the reference given on the authors' website/wikipedia and is extremely simple. If we ever experience issues, we might consider switching this to something of higher quality via an external library, candidates are `xxHASH` and `Murmur3`. https://github.com/Cyan4973/xxHash Note: This should further relieve the memory pressure on larger scale simulation as formulated in #1969 and make #2005 less urgent. There is no performance impact (at laptop scale), but the memory savings are worth it.
Showing
- arbor/benchmark_cell_group.cpp 2 additions, 3 deletionsarbor/benchmark_cell_group.cpp
- arbor/cable_cell.cpp 12 additions, 6 deletionsarbor/cable_cell.cpp
- arbor/cable_cell_param.cpp 8 additions, 4 deletionsarbor/cable_cell_param.cpp
- arbor/communication/mpi_context.cpp 5 additions, 7 deletionsarbor/communication/mpi_context.cpp
- arbor/fvm_lowered_cell_impl.hpp 27 additions, 34 deletionsarbor/fvm_lowered_cell_impl.hpp
- arbor/include/arbor/cable_cell.hpp 5 additions, 5 deletionsarbor/include/arbor/cable_cell.hpp
- arbor/include/arbor/cable_cell_param.hpp 4 additions, 3 deletionsarbor/include/arbor/cable_cell_param.hpp
- arbor/include/arbor/common_types.hpp 4 additions, 0 deletionsarbor/include/arbor/common_types.hpp
- arbor/include/arbor/cv_policy.hpp 1 addition, 1 deletionarbor/include/arbor/cv_policy.hpp
- arbor/include/arbor/util/hash_def.hpp 65 additions, 12 deletionsarbor/include/arbor/util/hash_def.hpp
- arbor/label_resolution.cpp 39 additions, 25 deletionsarbor/label_resolution.cpp
- arbor/label_resolution.hpp 10 additions, 15 deletionsarbor/label_resolution.hpp
- arbor/lif_cell_group.cpp 2 additions, 2 deletionsarbor/lif_cell_group.cpp
- arbor/spike_source_cell_group.cpp 1 addition, 3 deletionsarbor/spike_source_cell_group.cpp
- arborio/cableio.cpp 7 additions, 5 deletionsarborio/cableio.cpp
- python/cells.cpp 1 addition, 1 deletionpython/cells.cpp
- test/unit/CMakeLists.txt 1 addition, 0 deletionstest/unit/CMakeLists.txt
- test/unit/test_cable_cell.cpp 14 additions, 12 deletionstest/unit/test_cable_cell.cpp
- test/unit/test_fvm_lowered.cpp 66 additions, 42 deletionstest/unit/test_fvm_lowered.cpp
- test/unit/test_hash.cpp 24 additions, 0 deletionstest/unit/test_hash.cpp
Please register or sign in to comment