Do not parallelize deserialize operation (#1663)
Deserialize operations are faster when done serially with the MT banking stage and helps with performance improvement with reduced thread context switches.
This commit is contained in:
parent
5ecb9da801
commit
dffa2eb04f
|
@ -11,7 +11,6 @@ use log::Level;
|
||||||
use packet::Packets;
|
use packet::Packets;
|
||||||
use poh_recorder::{PohRecorder, PohRecorderError};
|
use poh_recorder::{PohRecorder, PohRecorderError};
|
||||||
use poh_service::{Config, PohService};
|
use poh_service::{Config, PohService};
|
||||||
use rayon::prelude::*;
|
|
||||||
use result::{Error, Result};
|
use result::{Error, Result};
|
||||||
use service::Service;
|
use service::Service;
|
||||||
use sigverify_stage::VerifiedPackets;
|
use sigverify_stage::VerifiedPackets;
|
||||||
|
@ -122,7 +121,7 @@ impl BankingStage {
|
||||||
/// an unused `SocketAddr` that could be used to send a response.
|
/// an unused `SocketAddr` that could be used to send a response.
|
||||||
fn deserialize_transactions(p: &Packets) -> Vec<Option<(Transaction, SocketAddr)>> {
|
fn deserialize_transactions(p: &Packets) -> Vec<Option<(Transaction, SocketAddr)>> {
|
||||||
p.packets
|
p.packets
|
||||||
.par_iter()
|
.iter()
|
||||||
.map(|x| {
|
.map(|x| {
|
||||||
deserialize(&x.data[0..x.meta.size])
|
deserialize(&x.data[0..x.meta.size])
|
||||||
.map(|req| (req, x.meta.addr()))
|
.map(|req| (req, x.meta.addr()))
|
||||||
|
|
Loading…
Reference in New Issue