Use rayon to speed up subscribe message serializing

This commit is contained in:
James Wilson
2021-08-06 17:42:03 +01:00
parent 0788270756
commit 74cf55174e
8 changed files with 49 additions and 25 deletions
+2 -2
View File
@@ -348,8 +348,8 @@ impl Chain {
pub fn get_node(&self, id: ChainNodeId) -> Option<&Node> {
self.nodes.get(id)
}
pub fn iter_nodes(&self) -> impl Iterator<Item = (ChainNodeId, &Node)> {
self.nodes.iter()
pub fn nodes_slice(&self) -> &[Option<Node>] {
self.nodes.as_slice()
}
pub fn label(&self) -> &str {
&self.labels.best()
+2 -2
View File
@@ -286,8 +286,8 @@ impl<'a> StateChain<'a> {
pub fn finalized_block(&self) -> &'a Block {
self.chain.finalized_block()
}
pub fn iter_nodes(&self) -> impl Iterator<Item = (ChainNodeId, &'a Node)> + 'a {
self.chain.iter_nodes()
pub fn nodes_slice(&self) -> &[Option<Node>] {
self.chain.nodes_slice()
}
}