{"id":28391879,"url":"https://github.com/wildpixelgames/gdt-cpus","last_synced_at":"2026-03-10T14:34:01.225Z","repository":{"id":294775055,"uuid":"988053404","full_name":"WildPixelGames/gdt-cpus","owner":"WildPixelGames","description":"Game Developer's Toolkit for CPU Management","archived":false,"fork":false,"pushed_at":"2025-12-04T18:33:30.000Z","size":390,"stargazers_count":103,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-06T00:57:39.382Z","etag":null,"topics":["cpu","ffi","gamedev","gdt","hybrid-cpu","multithreading","performance","realtime","rust","scheduling","systems-programming","thread-affinity"],"latest_commit_sha":null,"homepage":"https://wildpixelgames.github.io/gdt-cpus/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WildPixelGames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-22T01:43:16.000Z","updated_at":"2025-12-04T18:31:44.000Z","dependencies_parsed_at":"2025-09-03T05:38:03.407Z","dependency_job_id":"ff320671-4582-4a2a-a91e-d0b28f2f0aca","html_url":"https://github.com/WildPixelGames/gdt-cpus","commit_stats":null,"previous_names":["wildpixelgames/gdt-cpus"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WildPixelGames/gdt-cpus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildPixelGames%2Fgdt-cpus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildPixelGames%2Fgdt-cpus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildPixelGames%2Fgdt-cpus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildPixelGames%2Fgdt-cpus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WildPixelGames","download_url":"https://codeload.github.com/WildPixelGames/gdt-cpus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildPixelGames%2Fgdt-cpus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30337297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T12:41:07.687Z","status":"ssl_error","status_checked_at":"2026-03-10T12:41:06.728Z","response_time":106,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cpu","ffi","gamedev","gdt","hybrid-cpu","multithreading","performance","realtime","rust","scheduling","systems-programming","thread-affinity"],"created_at":"2025-05-31T10:38:56.056Z","updated_at":"2026-03-10T14:34:01.216Z","avatar_url":"https://github.com/WildPixelGames.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **gdt-cpus** – Game Developer's Toolkit for CPU Management\n\n\u003cp align=\"center\"\u003e\u003cb\u003e\u003ci\u003ePin it. Prioritize it. Dominate it.\u003c/i\u003e\u003c/b\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-quick-flex\"\u003e\u003cimg src=\"https://img.shields.io/badge/Rust-E57324?style=for-the-badge\u0026logo=rust\u0026logoColor=white\" alt=\"Rust\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/gdt-cpus\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/gdt-cpus.svg?style=for-the-badge\u0026color=orange\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/gdt-cpus\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs‑rs-online-orange.svg?style=for-the-badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-orange?style=for-the-badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nYou've got cores. *A lot of them.* Stop letting your OS babysit them like it's 2004.\n\nWith `gdt-cpus`, you **take control**. Hybrid architectures? P/E cores? SMT voodoo? Handled.\n\nWindows, Linux, macOS? Handled.\n\nYour ego? Also handled — this lib *knows* you're here to squeeze every last nanosecond.\n\n---\n\n## ✨ **Features That Actually Matter**\n\n\u003e *Monitoring and NUMA awareness? Out of scope for now.\n\u003e Why? Because you've got more important things to ship first.*\n\n* 🗺️ **CPU Topology? Got it.**\n\n  Vendor, model, sockets, cores, logical threads, cache hierarchies. No more guessing what you're running on.\n\n* 🧟‍♂️ **Hybrid-Aware like a Boss**\n\n  Detect and exploit P-cores and E-cores. Be the scheduler your OS wishes it could be.\n\n* 🪢 **Thread Affinity API**\n\n  Pin threads to specific cores. Dominate cache locality. Laugh at poor thread migrations.\n\n* 🎚️ **Thread Priority Control**\n\n  From *lowly background* to *time-critical god mode*.\n\n* 🎮 **Game-Dev First**\n\n  You won't find some academic NUMA experiments here. Just *useful* tools for real-time workloads.\n\n* 🧩 **C FFI Support**\n\n  Because your C++ friends need to know how to party too. (Or just call `gdt-cpus-sys` directly.)\n  With full CMake support. No more CMake hell. See `examples/c/basic_info` for details.\n\n* 🛡️ **Minimal Dependencies You'll Regret**\n\n  `log`, `thiserror`. That's it. No shady transitive surprises.\n\n  \u003e (Okay fine… `raw-cpuid`, `windows`, `libc`, `mach` — because CPUs still mumble in syscalls.)\n\n---\n\n## 🚀 **Quick Flex**\n\n```rust\nuse gdt_cpus::*;\n\nprintln!(\"Physical cores: {}\", num_physical_cores());\nprintln!(\"Logical cores: {}\", num_logical_cores());\n\npin_thread_to_core(0).expect(\"This thread is going nowhere else now.\");\nset_thread_priority(ThreadPriority::AboveNormal).unwrap();\n\nif is_hybrid() {\n    println!(\"P/E Cores? Oh, we're playing on expert difficulty.\");\n}\n```\n\n---\n\n## 🏎️ **Under The Hood: How We Tame The Silicon Beast**\n\n`gdt-cpus` isn't just calling `num_cpus::get()`. That's for amateurs. We dive deep into OS-specific APIs so you don't have to:\n\n| OS | API Madness We Handle |\n|----|------------------------|\n| **Windows** | `GetLogicalProcessorInformationEx`, Registry, `SetThreadAffinityMask` |\n| **Linux** | `sysfs`, `/proc/cpuinfo`, `cpuid`, `sched_setaffinity`, `setpriority` |\n| **macOS** | `sysctl`, `cpuid` (x86), QoS, `thread_policy_set` |\n\nAll this pain, abstracted away into one beautiful, cross-platform Rust API. We do the dirty work. You reap the rewards.\n\n\u003e \"Abstraction without insight is just hiding the problem. `gdt-cpus` gives you both.\"\n\n---\n\n## 🔥 **Hybrid CPU Dominance: P-Cores \u0026 E-Cores on a Leash**\n\nThose P-cores and E-cores? They're not just suggestions. `gdt-cpus` tells you exactly what you've got, so you (or your job system) can:\n\n### P-Cores (Performance)\n\nUnleash the beasts for your critical, latency-sensitive work. Pin 'em if you got 'em (and if your OS isn't Apple).\n\n### E-Cores (Efficiency)\n\nPerfect for background tasks, parallel number crunching that can wait, or just saving your laptop's battery. Offload wisely.\n\n`gdt-cpus` gives you the intel. Using it to make your app scream (or sip power) is up to you.\n\n---\n\n## 📊 **Performance Proof: Lower Latency, Smoother Frames**\n\nWords are wind. `gdt-cpus` enables real, measurable wins:\n\n| Scenario | Standard | With gdt-cpus | Improvement |\n|----------|----------|---------------|-------------|\n| **Audio Latency** (p99 Jitter µs, Linux i7) | 948,188 | ~0 (TimeCritical) | ~100% |\n| **Frame Jitter** (p99 Jitter µs, Linux i7) | 52 | 5 (Highest Priority) | 90% |\n| **Task Latency** (p99 µs, macOS M3 Max) | 1,732 | 997 (P/E Strategy) | 42% |\n| **Streaming Pipeline** (p50 Latency µs, macOS) | 4,743 | 3,517 (Prioritized) | 26% |\n\nThese aren't just numbers, they're your app running better. You're welcome.\n\n---\n\n## 🤔 **gdt-cpus vs. The \"Alternatives\" (Bless Their Hearts)**\n\nSure, there are other ways to poke at your CPU. If you like basic, or platform-locked, or just... less.\n\n| Capability | `gdt-cpus` (The Pro) | `num_cpus` (The Intern) | `raw-cpuid` (The x86 Nerd) | OS APIs (The DIY Nightmare) |\n|------------|----------------------|--------------------------|----------------------------|-----------------------------|\n| Core Counts | 👑 | 👍 | 🤷 | 😬 |\n| Full Topology (Cache, Sockets) | 👑 | ❌ | 🔬 (x86) | 🤯 |\n| P/E Core Detection | 👑 | ❌ | ❌ | 🧩 |\n| Thread Affinity | 👑 | ❌ | ❌ | 🧩 |\n| Thread Priority | 👑 | ❌ | ❌ | 🧩 |\n| Cross-Platform Ease | 👑 | 👍 | limited | ❌❌❌ |\n\n\u003e We ❤️ `num_cpus` – full respect!\u003cbr\u003e\n\u003e Our brains just speak in sarcasm \u0026 memes 🤷‍♂️\u003cbr\u003e\n\u003e (`num_cpus` paved the way for CPU introspection in Rust – `gdt-cpus` just straps a rocket to it. 🚀)\n\nChoose wisely. Or just choose `gdt-cpus` and be done with it.\n\n---\n\n## 🧠 **The SWOT Analysis (Because We're \"Strategic\")**\n\n### 💪 Strengths (Obvious Stuff)\n\n* Deep CPU insights, cross-platform.\n* P/E core aware. Your hybrid CPU will love you.\n* Thread pinning \u0026 priority control that *works*.\n* Foundation for god-tier task systems (hi, `gdt-jobs`!).\n* C FFI via `gdt-cpus-sys`? Check. Your C++ will thank you.\n\n### 📉 Weaknesses (If We *Must*)\n\n* Not magic. You still gotta write good code on top.\n* Apple Silicon affinity? Apple says \"lol no\". We report that accurately.\n* Might be overkill if all you need is `num_cpus::get()`. (But why settle?)\n\n### 🚀 Opportunities (World Domination Plans)\n\n* More NUMA smarts for server beasts.\n* Even *more* detailed cache info. Because why not.\n* Your favorite engine using `gdt-cpus` under the hood.\n\n### ⚠️ Threats (The Competition... Kinda)\n\n* OS schedulers *might* get smarter. Someday. Maybe.\n* Someone writing an even *more* arrogant README. Unlikely.\n\n---\n\n## 🌐 **Proven on Real Hardware**\n\nTested across:\n\n* 🐧 Linux with baremetal and containers (LXC-tested, yes, it even respects *your* artificial limits)\n* 🪟 Windows (Hyper-Threading chaos? We navigate it.)\n* 🍎 macOS (Including Apple Silicon and their obsession with Efficiency Cores)\n\n\u003e Curious what it actually prints? Check out docs/basic_info.md for full example output.\n\n---\n\n## **Versioning - CalVer, Deal With It**\n\n\u003e Wait, CalVer for a lib? Ya Idjits or something?\u003cbr\u003e\n\u003e (Bobby Singer voice, obviously.)\n\nYep, we timestamp our releases instead of counting up semantic digits. Why? Because we're just built different. And because:\n\n| CalVer Perk           | Why You Care |\n|-----------------------|--------------|\n|Instant age check      | `25.5.0` → May 2025. No need to diff tags to see if a crate is fossilized or fresh off the compiler.|\n|Honesty about breakage | New month? Could be a breaking change. You’ll know from the number *and* from a Migration Guide `25.4` → `25.5` in the repo. We're not shy.|\n|Works fine with Cargo  | `cargo add gdt-cpus@=25.5` still pins the May 2025 API line; you won’t auto-upgrade to `25.12` nor `26.1` unless you explicitly ask for it. Cargo gets it.|\n|Less bike-shedding     | We’d rather spend time tuning work-steal loops and optimizing P/E core scheduling than debating whether the last commit was “minor” or “patch”. Priorities, people.|\n\n**TL;DR**:\n\nEach year/month is an API epoch. If we break you, the migration doc shows the fix; if we don’t, cargo update is painless.\n\nAnd if we mess up, the date tells you exactly when to roast us in Issues. 😎\n\n\u003e (We’re not idjits – just impatient.)\n\n---\n\n## **How Can I Contribute?**\n\nFind something that’s missing, broken, or just less performant than your standards require.\n\nOpen an issue. Bonus points if you make a PR. A 🍪 if benchmarks go brrrrr.\n\nBut wait, where is the **CODE_OF_CONDUCT**?\n\n**Code of what?** Quoting a famous internet meme:\n\n\u003e “Apologies for the very personal question, but were you homeschooled by a pigeon?”\n\nWe're all civilised here. Just don't be an asshole and we're good. 🤞🏻\n\nAnd hey, mad props to the entire Rust community. Y'all make low-level coding sexy again. This stuff is built with love, for the love of the game (and performant Rust).\n\n---\n\n## 🧩 **Part of the GDT Ecosystem**\n\n`gdt-cpus` is part of the Game Developer's Toolkit — libraries built with years of experience from top-tier studios:\n\n* **gdt-cpus** - Pin it. Prioritize it. Dominate it. You're looking at it right now!\n* **gdt-jobs** - High-performance task execution built for games and sims needing serious parallelism.\n* **gdt-memory** (Coming Soon) - Because your RAM deserves a tyrant, not a suggestion.\n\n---\n\n## 📦 **Add to Your Project Like a Professional**\n\n```bash\ncargo add gdt-cpus\n```\n\nOr just copy-paste like it's still the 90s. We don't judge.\n\n---\n\n## 🔥 **Use Cases**\n\n* Write a physics solver that doesn't feel like it's running on a potato.\n* Make sure your background AI calculations stay *in the background*.\n* Pin your loading threads to E-cores and gameplay to P-cores. Instant karma.\n* Benchmark that ridiculous 64-core Threadripper you overpaid for.\n\n\u003e *Remember*: Your OS works *for* you, not the other way around.\n\u003e Pin those threads. Prioritize them. And go write code that makes the fans spin.\n\n---\n\n## ⚖️ **License**\n\nMIT OR Apache-2.0 — because we believe in *freedom of choice* (and legally covering our butts).\n\n---\n\n\u003cp align=\"center\"\u003eMade with ❤️ by \u003ca href=\"https://wildpixelgames.com\"\u003eWild Pixel Games\u003c/a\u003e - We know CPUs.\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ci\u003e\"My CPU used to cry itself to sleep. Then I found \u003ccode\u003egdt-cpus\u003c/code\u003e.\"\u003c/i\u003e – A Very Smart Developer\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildpixelgames%2Fgdt-cpus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildpixelgames%2Fgdt-cpus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildpixelgames%2Fgdt-cpus/lists"}