-
Notifications
You must be signed in to change notification settings - Fork 827
Open
Description
Feature description
burn has already had the dependency, tokio, which is efficient for task scheduling.
Lines 110 to 112 in 5923b1e
| tokio = { version = "1.49.0", features = ["rt", "macros"] } | |
| tokio-tungstenite = "0.28" | |
| tokio-util = "0.7" |
But async_policy use std rust channel.
burn/crates/burn-rl/src/policy/async_policy.rs
Lines 1 to 8 in 5923b1e
| use std::{ | |
| sync::{ | |
| Arc, | |
| atomic::{AtomicUsize, Ordering}, | |
| mpsc::{self, Sender}, | |
| }, | |
| thread::spawn, | |
| }; |
I guess, reasons for this are:
- To avoid context switching overhead
- Not necessary because messages are processed in a dedicated thread
- To avoid function coloring
If so, crossbeam may be a candidate for better performance.
Feature motivation
(Optional) Suggest a Solution
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels