T-70: M1.2c — tools/curate-etl: pure corporate_actions builder (splits + dividends + OTC continuation / Shumway terminal delisting rows) with local benchmark (no new crates)
This commit is contained in:
parent
740014a4d0
commit
96f7aedd4b
1 changed files with 4 additions and 4 deletions
|
|
@ -158,7 +158,7 @@ pub fn run_adj_benchmark(events: usize) -> Result<AdjBenchReport, AdjError> {
|
|||
let mut dividends: Vec<(i32, DividendEvent)> = Vec::with_capacity(events);
|
||||
|
||||
for _ in 0..events {
|
||||
let key = (rng.next_u64() % (BENCH_KEY_COUNT as u64)) as i32 + 1;
|
||||
let key = ((rng.next_u64() as usize) % BENCH_KEY_COUNT) as i32 + 1;
|
||||
let ex_date = min_date + (rng.next_u64() % date_span) as i32;
|
||||
let kind_roll = rng.next_u64() % 100;
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ pub fn run_adj_benchmark(events: usize) -> Result<AdjBenchReport, AdjError> {
|
|||
let ratio = if ratio_roll == 0 {
|
||||
1.0
|
||||
} else {
|
||||
SAMPLE_RATIOS[(rng.next_u64() % (SAMPLE_RATIOS.len() as u64)) as usize]
|
||||
SAMPLE_RATIOS[(rng.next_u64() as usize) % SAMPLE_RATIOS.len()]
|
||||
};
|
||||
splits.push((key, SplitEvent { ex_date, ratio }));
|
||||
} else {
|
||||
|
|
@ -283,7 +283,7 @@ pub fn run_corporate_actions_benchmark(
|
|||
let mut delistings: Vec<(i32, DelistingOutcomeEvent<i32>)> = Vec::with_capacity(events / 20);
|
||||
|
||||
for _ in 0..events {
|
||||
let key = (rng.next_u64() % (BENCH_KEY_COUNT as u64)) as i32 + 1;
|
||||
let key = ((rng.next_u64() as usize) % BENCH_KEY_COUNT) as i32 + 1;
|
||||
let ex_date = min_date + (rng.next_u64() % date_span) as i32;
|
||||
let kind_roll = rng.next_u64() % 100;
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ pub fn run_corporate_actions_benchmark(
|
|||
let ratio = if ratio_roll == 0 {
|
||||
1.0
|
||||
} else {
|
||||
SAMPLE_RATIOS[(rng.next_u64() % (SAMPLE_RATIOS.len() as u64)) as usize]
|
||||
SAMPLE_RATIOS[(rng.next_u64() as usize) % SAMPLE_RATIOS.len()]
|
||||
};
|
||||
let decl_roll = rng.next_u64() % 100;
|
||||
let declared_date = if decl_roll < 30 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue