-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nlog: replace concurrenthashmap to phmap::parallel_hash_map #441
Comments
I did not asked about this is yesterday as I thought you guys were a bit busy with work. I wanna know that do I have to create a new header file in the concurrent folder where the src/NativeLog/Base/Concurrent/ConcurrentHashMap.h is implemented? Or should I just add the phmap file from the https://github.com/greg7mdp/parallel-hashmap?tab=readme-ov-file#overview and make the modifications replacing the usage of concurrantHashMap? |
glad to see you wanna work on this issue! Have you check the map impl? we use a shared_mutex and a map right? this is a manual way to control the thread-safe. and we wanna switch to the new map. basically, we need to add a submodule first, then replace the map impl inside the header. and ensure compile pass, and our testing pass. extra: we can add a new benchmark to check performance. we internally host a google benchmark style. |
step 0: you need to ensure the current proton has been built locally(either by docker mount or bare mental build). we use clang-16 compiler , check build.md here. further: if we can have a benchmark showing the performance upgrade would be great. we have using the google benchmark style. this require create a folder. |
the first time build proton will be painful, and need one hour longer. if you install c-cache it will save more time to do only incremental building. (calculate the changed file from a hash alg, and only build the changed one) |
OMG thank you for this much help. =) I did looked at the https://github.com/timeplus-io/proton/blob/develop/src/NativeLog/Base/Concurrent/ConcurrentHashMap.h This is how I add the |
|
Setting-up according to the build.md is having some problems - I tried following the bare-metal steps 3 times https://github.com/timeplus-io/proton/blob/develop/BUILD.md#bare-metal-build but my terminal crashed/closed after running for quite a while. Then I did the build with docker https://github.com/timeplus-io/proton/blob/develop/BUILD.md#bare-metal-build below SS has the build_docker folder - I used this command and because of this unable to run the server on my local pc - [~/proton]
✘ devansh develop sudo ./programs server --config-file ../programs/server/config.yaml
[sudo] password for devansh:
sudo: ./programs: command not found
|
Thanks for reporting this issue. We only supported / validated clang-16 tool chain for compiling for the latest code base. |
this is still not easy for newcomer, I remove the label, and after #660 proton now has boost::concurrent_flat_map |
Describe what enhancement you'd like to have
We are currently using a basic concurrent hashmap implementation in Proton nativelog , which utilizes an internal
std::shared_mutex
(functioning like a read/write mutex). We propose to transition to a more advanced concurrent hashmap.one of choice is the https://github.com/greg7mdp/parallel-hashmap a widely-used hashmap in OLAP systems such as https://github.com/apache/doris.git
This hashmap's foundational design is inspired by absl but includes additional optimizations for enhanced thread safety and performance. A notable feature is its locking mechanism at the submap level, allowing for high concurrency.
We can conduct benchmark tests and consider replacing our current implementation. For detailed design insights, refer to: https://greg7mdp.github.io/parallel-hashmap/
full benchmark can be found here(update in 2022) https://martin.ankerl.com/2022/08/27/hashmap-bench-01/
The text was updated successfully, but these errors were encountered: