Revert "perf: cache symbol board classification"
This reverts commit eb8b14602a.
This commit is contained in:
@@ -1326,7 +1326,6 @@ pub struct DataSet {
|
||||
benchmark_series_cache: Arc<BenchmarkPriceSeries>,
|
||||
symbol_id_by_code: Arc<AHashMap<String, u32>>,
|
||||
symbol_by_id: Arc<Vec<Arc<str>>>,
|
||||
symbol_is_bjse_by_id: Arc<Vec<bool>>,
|
||||
eligible_universe_by_date: Arc<OnceLock<BTreeMap<NaiveDate, Vec<EligibleUniverseSnapshot>>>>,
|
||||
benchmark_code: String,
|
||||
futures_params_by_symbol: Arc<HashMap<String, Vec<FuturesTradingParameter>>>,
|
||||
@@ -1775,10 +1774,6 @@ impl DataSet {
|
||||
for (symbol, symbol_id) in &symbol_id_by_code {
|
||||
symbol_by_id[*symbol_id as usize] = Arc::<str>::from(symbol.as_str());
|
||||
}
|
||||
let symbol_is_bjse_by_id = symbol_by_id
|
||||
.iter()
|
||||
.map(|symbol| symbol_is_bjse(symbol))
|
||||
.collect::<Vec<_>>();
|
||||
let mut instruments_by_symbol_id = vec![None; symbol_id_by_code.len()];
|
||||
for (symbol, instrument) in &instruments {
|
||||
if let Some(symbol_id) = symbol_id_by_code.get(symbol).copied() {
|
||||
@@ -1868,7 +1863,6 @@ impl DataSet {
|
||||
benchmark_series_cache: Arc::new(benchmark_series_cache),
|
||||
symbol_id_by_code: Arc::new(symbol_id_by_code),
|
||||
symbol_by_id: Arc::new(symbol_by_id),
|
||||
symbol_is_bjse_by_id: Arc::new(symbol_is_bjse_by_id),
|
||||
eligible_universe_by_date: Arc::new(OnceLock::new()),
|
||||
benchmark_code,
|
||||
futures_params_by_symbol: Arc::new(futures_params_by_symbol),
|
||||
@@ -1927,13 +1921,6 @@ impl DataSet {
|
||||
(!symbol.is_empty()).then(|| Arc::clone(symbol))
|
||||
}
|
||||
|
||||
pub(crate) fn symbol_is_bjse_by_id(&self, symbol_id: u32) -> bool {
|
||||
self.symbol_is_bjse_by_id
|
||||
.get(symbol_id as usize)
|
||||
.copied()
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
pub(crate) fn symbol_count(&self) -> usize {
|
||||
self.symbol_id_by_code.len()
|
||||
}
|
||||
@@ -4100,18 +4087,6 @@ fn normalized_field(field: &str) -> Cow<'_, str> {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn symbol_is_bjse(symbol: &str) -> bool {
|
||||
let normalized = symbol.trim();
|
||||
normalized
|
||||
.get(normalized.len().saturating_sub(3)..)
|
||||
.is_some_and(|suffix| {
|
||||
suffix.eq_ignore_ascii_case(".BJ") || suffix.eq_ignore_ascii_case(".BE")
|
||||
})
|
||||
|| normalized
|
||||
.get(normalized.len().saturating_sub(4)..)
|
||||
.is_some_and(|suffix| suffix.eq_ignore_ascii_case(".BSE"))
|
||||
}
|
||||
|
||||
fn normalize_factor_snapshots(factors: Vec<DailyFactorSnapshot>) -> Vec<DailyFactorSnapshot> {
|
||||
factors
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user