mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-16 10:28:05 +00:00
refactor: convert EventParser to static methods and optimize caching
- Replace instance-based EventParser with static method design - Introduce ParserCache module for protocol config caching - Simplify EventProcessor to pure functional handlers - Optimize metrics: remove min/max tracking, keep last + avg only - Reduce atomic operations in hot path for better performance
This commit is contained in:
@@ -2,7 +2,7 @@ use crate::streaming::event_parser::common::{
|
||||
types::EventType, ACCOUNT_EVENT_TYPES, BLOCK_EVENT_TYPES,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq, Hash)]
|
||||
pub struct EventTypeFilter {
|
||||
pub include: Vec<EventType>,
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ pub enum ProtocolType {
|
||||
|
||||
/// Event type enumeration
|
||||
#[derive(
|
||||
Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize, BorshSerialize, BorshDeserialize,
|
||||
Debug, Clone, Default, PartialEq, Eq, Hash, Serialize, Deserialize, BorshSerialize, BorshDeserialize,
|
||||
)]
|
||||
pub enum EventType {
|
||||
// PumpSwap events
|
||||
|
||||
Reference in New Issue
Block a user