https://github.com/nviennot/core-to-core-latency Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Changelog * Solutions + By Size + Enterprise + Teams + Compare all + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} nviennot / core-to-core-latency Public * Notifications * Fork 1 * Star 98 Measures the latency between CPU cores 98 stars 1 fork Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights nviennot/core-to-core-latency This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 2 tags Code * Clone HTTPS GitHub CLI [https://github.com/n] Use Git or checkout with SVN using the web URL. [gh repo clone nvienn] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @nviennot nviennot Added AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) ... 2b4c073 Sep 18, 2022 Added AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) 2b4c073 Git stats * 15 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time results Added AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) Sep 18, 2022 src Add warning on macOS Sep 18, 2022 .gitignore nits Sep 18, 2022 Cargo.lock Release v1.0.0 Sep 18, 2022 Cargo.toml Release v1.0.0 Sep 18, 2022 README.md Added AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) Sep 18, 2022 View code [ ] Measuring CPU core-to-core latency Results Intel Core i9-12900K @ 8+8 Cores (Alder Lake, 12th gen) 2021-Q4 Intel Xeon Platinum 8375C @ 2.90GHz 32 Cores (Ice Lake, 3rd gen) 2021-Q2 Intel Xeon Platinum 8275CL @ 3.00GHz 24 Cores (Cascade Lake, 2nd gen) 2019-Q2 Intel(R) Core(TM) i7-1165G7 @ 2.80GHz 4 Cores (Tiger Lake, 11th gen) 2020-Q3 Intel Core i9-9900K @ 3.60 GHz 8 Cores (Coffee Lake, 8th gen) 2018-Q4 Intel Xeon E5-2695 v4 @ 2.10GHz 18 Cores (Broadwell, 5th gen) 2016-Q1 Intel Core i5-4590 CPU @ 3.30GHz 4 Cores (Haswell, 4th gen) 2014-Q2 AMD EPYC 7R13 @ 48 Cores (Milan, 3rd gen) 2021-Q1 AMD Ryzen 9 5950X @ 3.40 GHz 16 Cores (Zen3, 4th gen) 2020-Q1 AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) 2018-Q3 AWS Graviton3 @ 64 Cores (Arm Neoverse, 3rd gen) 2021-Q4 AWS Graviton2 @ 64 Cores (Arm Neoverse, 2nd gen) 2020-Q1 How to use Contribute License README.md Measuring CPU core-to-core latency License Cargo We measure the latency it takes for a CPU to send a message to another CPU via its cache coherence protocol. By pinning two threads on two different CPU cores, we can get them to do a bunch of compare-exchange operation, and measure the latency. How to run: $ cargo install core-to-core-latency $ core-to-core-latency Results CPU Release Median Date Latency Intel Core i9-12900K @ 8+8 Cores (Alder Lake, 2021-Q4 35ns, 44ns, 12th gen) 50ns Intel Xeon Platinum 8375C @ 2.90GHz 32 Cores 2021-Q2 51ns (Ice Lake, 3rd gen) Intel Xeon Platinum 8275CL @ 3.00GHz 24 Cores 2019-Q2 47ns (Cascade Lake, 2nd gen) Intel Core i7-1165G7 @ 2.80GHz 4 Cores (Tiger 2020-Q3 27ns Lake, 11th gen) Intel Core i9-9900K @ 3.60 GHz 8 Cores (Coffee 2018-Q4 21ns Lake, 9th gen) Intel Xeon E5-2695 v4 @ 2.10GHz 18 Cores 2016-Q1 44ns (Broadwell, 5th gen) Intel Core i5-4590 CPU @ 3.30GHz 4 Cores 2014-Q2 21ns (Haswell, 4th gen) AMD EPYC 7R13 @ 48 Cores (Milan, 3rd gen) 2021-Q1 23ns and 107ns AMD Ryzen 9 5950X @ 3.40 GHz 16 Cores (Zen3, 4th 2020-Q4 17ns and gen) 85ns AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd 2018-Q3 24ns and gen) 92ns AWS Graviton3 @ 64 Cores (Arm Neoverse, 3rd gen) 2021-Q4 46ns AWS Graviton2 @ 64 Cores (Arm Neoverse, 2rd gen) 2020-Q1 47ns Apple M1 2020-Q4 39ns Apple M1 Max 2021-Q4 39ns See the notebook for additional CPU graphs: results/results.ipynb, it includes hyperthreading and dual socket configurations Intel Core i9-12900K @ 8+8 Cores (Alder Lake, 12th gen) 2021-Q4 Data provided by bizude. This CPU has 8 performance cores, and 2 groups of 4 efficient cores. We see CPU=8 with fast access to all other cores. [190930511-337ef53e-52c0-4350-9022-485689b7f242] Intel Xeon Platinum 8375C @ 2.90GHz 32 Cores (Ice Lake, 3rd gen) 2021-Q2 From an AWS c6i.metal machine. [190918865-7eaae192-6da6-41db-8faf-9496f6a7754b] Intel Xeon Platinum 8275CL @ 3.00GHz 24 Cores (Cascade Lake, 2nd gen) 2019-Q2 From an AWS c5.metal machine. [190918895-8b90cc12-2e72-41d1-808b-6f03a8771898] Intel(R) Core(TM) i7-1165G7 @ 2.80GHz 4 Cores (Tiger Lake, 11th gen) 2020-Q3 Data provided by Jonas Wunderlich [190929491-aededfc2-e0f5-4e2f-9508-3eb154fd9bb1] Intel Core i9-9900K @ 3.60 GHz 8 Cores (Coffee Lake, 8th gen) 2018-Q4 My gaming machine, it's twice as fast as the other server-oriented CPUs. [190918912-8b551b33-14e6-4cd3-a82d-8ac241d1abb6] Intel Xeon E5-2695 v4 @ 2.10GHz 18 Cores (Broadwell, 5th gen) 2016-Q1 From a machine provided by GTHost [190918934-a2b11676-e6e1-4b88-a8e4-6bf69663d477] Intel Core i5-4590 CPU @ 3.30GHz 4 Cores (Haswell, 4th gen) 2014-Q2 Data provided by Felipe Lube de Braganca [190928985-42e13598-f5dc-4b49-b67e-dc300207d3c7] AMD EPYC 7R13 @ 48 Cores (Milan, 3rd gen) 2021-Q1 From an AWS c6a.metal machine. We can see cores arranged in 6 groups of 8 in which latency is excellent within (23ns). When data crosses groups, the latency jumps to around 110ns. Note, that the last 3 groups have a better cross-group latency than the first 3 (~90ns). [190893255-56ea9890-9e06-4f2d-bcef-249a70c4597b] AMD Ryzen 9 5950X @ 3.40 GHz 16 Cores (Zen3, 4th gen) 2020-Q1 Data provided by John Schoenick. We can see 2 groups of 8 cores with latencies of 17ns intra-group, and 85ns inter-group. [190926938-400092a0-45ff-4a6c-816a-1b694767c993] AMD Ryzen 7 2700X @ 3.70 GHz 8 Cores (Zen+, 2nd gen) 2018-Q3 Data provided by David Hoppenbrouwers. We can see 2 groups of 4 cores with latencies of 24ns intra-group, and 92ns inter-group. [190931275-a4f8e842-a033-4438-9ceb-7f8a78951ec4] AWS Graviton3 @ 64 Cores (Arm Neoverse, 3rd gen) 2021-Q4 From an AWS c7g.16xlarge machine. [190919040-7d6d2283-cbef-4544-8b07-f93f71754343] AWS Graviton2 @ 64 Cores (Arm Neoverse, 2nd gen) 2020-Q1 From an AWS c6gd.metal machine. [190919053-11480075-6731-49ce-af03-f50bb27e8b33] See the notebook for additional CPU graphs: results/results.ipynb, it includes hyperthreading and dual socket configurations How to use First install Rust and gcc on linux, then: $ cargo install core-to-core-latency $ core-to-core-latency Num cores: 10 Using RDTSC to measure time: false Num round trips per samples: 1000 Num samples: 300 Showing latency=round-trip-time/2 in nanoseconds: 0 1 2 3 4 5 6 7 8 9 0 1 52+-6 2 38+-6 39+-4 3 39+-5 39+-6 38+-6 4 34+-6 38+-4 37+-6 36+-5 5 38+-5 38+-6 38+-6 38+-6 37+-6 6 38+-5 37+-6 39+-6 36+-4 49+-6 38+-6 7 36+-6 39+-5 39+-6 37+-6 35+-6 36+-6 38+-6 8 37+-5 38+-6 35+-5 39+-5 38+-6 38+-5 37+-6 37+-6 9 48+-6 39+-6 36+-6 39+-6 38+-6 36+-6 41+-6 38+-6 39+-6 Min latency: 34.5ns +-6.1 cores: (4,0) Max latency: 52.1ns +-9.4 cores: (1,0) Mean latency: 38.4ns Contribute Use core-to-core-latency 5000 --csv > output.csv to instruct the program to use 5000 iterations per sample to reduce the noise, and save the results. It can be used in the jupter notebook results/results.ipynb for rendering graphs. Create a GitHub issue with the generated output.csv file and I'll add your results. License This software is licensed under the MIT license About Measures the latency between CPU cores Resources Readme Stars 98 stars Watchers 3 watching Forks 1 fork Releases 1 v1.0.0-rc1 Latest Sep 18, 2022 Packages 0 No packages published Languages * Jupyter Notebook 99.9% * Rust 0.1% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.