Skip to content
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

[Merged by Bors] - Default to using ExecutorKind::SingleThreaded on wasm32 #7717

Closed

Conversation

james7132
Copy link
Member

Objective

Web builds do not support running on multiple threads right now. Defaulting to the multi-threaded executor has significant overhead without any benefit.

Solution

Default to the single threaded executor on wasm32 builds.

@james7132 james7132 added A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times O-Web Specific to web (WASM) builds labels Feb 16, 2023
@james7132 james7132 changed the title By default use ExecutorKind::SingleThreaded on wasm32 Default to using ExecutorKind::SingleThreaded on wasm32 Feb 16, 2023
@JMS55 JMS55 added this to the 0.10 milestone Feb 16, 2023
@mockersf
Copy link
Member

mockersf commented Feb 16, 2023

Would this change anything? I don't think the default impl for this enum is ever used inside Bevy

I think it should be used here to use the correct executor depending on the default ExecutorKind:

pub fn new() -> Self {
Self {
graph: ScheduleGraph::new(),
executable: SystemSchedule::new(),
executor: Box::new(MultiThreadedExecutor::new()),
executor_initialized: false,
}
}

@james7132
Copy link
Member Author

Nice catch. Should be used there now.

@james7132 james7132 added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 16, 2023
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

bors bot pushed a commit that referenced this pull request Feb 17, 2023
# Objective
Web builds do not support running on multiple threads right now. Defaulting to the multi-threaded executor has significant overhead without any benefit.

## Solution
Default to the single threaded executor on wasm32 builds.
@bors bors bot changed the title Default to using ExecutorKind::SingleThreaded on wasm32 [Merged by Bors] - Default to using ExecutorKind::SingleThreaded on wasm32 Feb 17, 2023
@bors bors bot closed this Feb 17, 2023
myreprise1 pushed a commit to myreprise1/bevy that referenced this pull request Feb 18, 2023
)

# Objective
Web builds do not support running on multiple threads right now. Defaulting to the multi-threaded executor has significant overhead without any benefit.

## Solution
Default to the single threaded executor on wasm32 builds.
@james7132 james7132 deleted the default-single-threaded-wasm branch February 18, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Performance A change motivated by improving speed, memory usage or compile times O-Web Specific to web (WASM) builds S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants