-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: use single threaded flecs #883
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the threading model for flecs systems to enforce single-threaded execution. Key changes include the removal of the .multi_threaded() calls from multiple system definitions and updating NUM_THREADS to 1 in the core configuration.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| events/tag/src/module/vanish.rs | Removed .multi_threaded() to run vanish events single-threaded. |
| events/tag/src/module/stats.rs | Removed .multi_threaded() from the stats system. |
| events/tag/src/module/regeneration.rs | Removed .multi_threaded() from the regeneration module. |
| events/tag/src/module/chat.rs | Removed .multi_threaded() from the chat system. |
| events/tag/src/module/bow.rs | Removed .multi_threaded() from both bow system blocks. |
| events/tag/src/module/block.rs | Removed .multi_threaded() from several block handling systems. |
| events/tag/src/module/attack.rs | Removed .multi_threaded() from attack handling systems. |
| crates/hyperion/src/simulation/metadata/mod.rs | Removed .multi_threaded() from metadata sync system. |
| crates/hyperion/src/simulation/inventory.rs | Removed .multi_threaded() from the inventory system. |
| crates/hyperion/src/lib.rs | Changed NUM_THREADS from 8 to 1 to match single-threaded execution. |
| crates/hyperion/src/ingress/mod.rs | Removed .multi_threaded() from the ingress processing. |
| crates/hyperion/src/egress/sync_entity_state.rs | Removed .multi_threaded() from multiple entity state sync systems. |
| crates/hyperion/src/egress/sync_chunks.rs | Removed .multi_threaded() from the full chunk sync system. |
| crates/hyperion/src/egress/mod.rs | Removed .multi_threaded() from the egress broadcast system. |
Comments suppressed due to low confidence (5)
events/tag/src/module/vanish.rs:38
- Removal of '.multi_threaded()' enforces single-threaded execution. Ensure that this change does not affect the intended concurrency behavior for handling vanished events.
.multi_threaded()
events/tag/src/module/stats.rs:22
- Removal of '.multi_threaded()' is consistent with a single-threaded approach; please verify that sequential processing here meets performance requirements.
.multi_threaded()
crates/hyperion/src/ingress/mod.rs:445
- The removal of '.multi_threaded()' here ensures immediate, single-threaded processing in ingress; confirm that this change does not lead to unintended delays or data race issues.
.multi_threaded()
crates/hyperion/src/egress/sync_entity_state.rs:55
- Ensure that removing '.multi_threaded()' does not impact the correct propagation of entity state synchronization, given timing and ordering considerations.
.multi_threaded()
crates/hyperion/src/lib.rs:28
- Changing NUM_THREADS to 1 aligns with the single-threaded execution model; ensure that all parts of the system are adjusted accordingly.
pub const NUM_THREADS: usize = 1;
Benchmark Results for generalComparing to d817614 |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #883 +/- ##
==========================================
- Coverage 20.91% 20.86% -0.05%
==========================================
Files 161 161
Lines 16876 16857 -19
Branches 469 469
==========================================
- Hits 3529 3518 -11
+ Misses 13283 13275 -8
Partials 64 64
🚀 New features to boost your workflow:
|
This reverts commit 24fff2e.
No description provided.