{"id":19691041,"url":"https://github.com/cameronclay/multithread-data-processor","last_synced_at":"2025-02-27T08:58:54.954Z","repository":{"id":242608626,"uuid":"806004219","full_name":"CameronClay/multithread-data-processor","owner":"CameronClay","description":"Explores many of the built-in thread synchronization objects and utilities in C++ 17/C++ 20, including std::thread, std::condition_variable, std::mutex, std::atomic, std::atomic::wait, std::async, std::future, std::for_each with execution_policy, and more. This project also contains a custom ParallelProcessor built with STL synchronization objects.","archived":false,"fork":false,"pushed_at":"2024-06-03T23:58:12.000Z","size":73,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"cmake-modules","last_synced_at":"2025-01-10T08:54:42.675Z","etag":null,"topics":["cmake","cpp20","cpp20-modules","google","googletest","multithreading","vcpkg"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CameronClay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-26T05:07:20.000Z","updated_at":"2024-06-03T23:58:15.000Z","dependencies_parsed_at":"2024-06-04T02:10:18.494Z","dependency_job_id":null,"html_url":"https://github.com/CameronClay/multithread-data-processor","commit_stats":null,"previous_names":["cameronclay/multithread-data-processor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameronClay%2Fmultithread-data-processor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameronClay%2Fmultithread-data-processor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameronClay%2Fmultithread-data-processor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CameronClay%2Fmultithread-data-processor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CameronClay","download_url":"https://codeload.github.com/CameronClay/multithread-data-processor/tar.gz/refs/heads/cmake-modules","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240996871,"owners_count":19891056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp20","cpp20-modules","google","googletest","multithreading","vcpkg"],"created_at":"2024-11-11T19:07:48.216Z","updated_at":"2025-02-27T08:58:54.930Z","avatar_url":"https://github.com/CameronClay.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multithreaded Data Processor\nThis project explores many of the built-in thread synchronization objects and utilities in C++ 17/C++ 20, including std::thread, std::condition_variable, std::mutex, std::atomic, std::atomic::wait, std::async, std::future, std::for_each with execution_policy, and more. This project also contains a custom ParallelProcessor built with STL synchronization objects.\n\n## Benchmarks\nMultiple execution methods including sequential, parallel, std::for_each, std::async are bnechmarked to see which is the fastest and to demonstrate they are all working correctly.\n\n### Unit Testing and Systems Testing\n- Unit testing and systems testing is done using Google Test.\n- The main program also performs basic systems testing inbetween the benchmarking\n\n### Tooling\n- C++ 20 (with **C++ 20 modules**)\n- Google Test\n- CMake\n- vcpkg\n- msvc compiler\n- Visual Studio Code\n- Visual Studio\n\n### Discussion\nMy ParallelProcessor implementation seems to be around 30% faster than std::for_each with parallel execution in the benchmarks. This performance difference could be due to compiler optimizations around inlining functions.\n\n```\nAvgs of 100 trials of 4000000 loops | single threaded time = 12.594 | std::for_each time = 1.383 \n--------------------------------------------------\nAvgs of 100 trials of 4000000 loops | multithreaded (1 threads) time = 8.027\nAvgs of 100 trials of 4000000 loops | multithreaded (2 threads) time = 4.143\nAvgs of 100 trials of 4000000 loops | multithreaded (3 threads) time = 2.803\nAvgs of 100 trials of 4000000 loops | multithreaded (4 threads) time = 2.137\nAvgs of 100 trials of 4000000 loops | multithreaded (5 threads) time = 1.795\nAvgs of 100 trials of 4000000 loops | multithreaded (6 threads) time = 1.511\nAvgs of 100 trials of 4000000 loops | multithreaded (7 threads) time = 1.354\nAvgs of 100 trials of 4000000 loops | multithreaded (8 threads) time = 1.263\nAvgs of 100 trials of 4000000 loops | multithreaded (9 threads) time = 1.192\nAvgs of 100 trials of 4000000 loops | multithreaded (10 threads) time = 1.172\nAvgs of 100 trials of 4000000 loops | multithreaded (11 threads) time = 1.096\nAvgs of 100 trials of 4000000 loops | multithreaded (12 threads) time = 1.109\nAvgs of 100 trials of 4000000 loops | multithreaded (13 threads) time = 1.051\nAvgs of 100 trials of 4000000 loops | multithreaded (14 threads) time = 1.015\nAvgs of 100 trials of 4000000 loops | multithreaded (15 threads) time = 1.027\nAvgs of 100 trials of 4000000 loops | multithreaded (16 threads) time = 0.984\n--------------------------------------------------\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronclay%2Fmultithread-data-processor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronclay%2Fmultithread-data-processor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronclay%2Fmultithread-data-processor/lists"}