优化: 共用一次 store.GetAll() 快照,消除每 tick 两次 map 分配

This commit is contained in:
jackyu66git
2026-05-04 06:10:37 +08:00
parent 5aedcb6566
commit 2f4d03f9b1
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -179,12 +179,12 @@ func main() {
t1 := time.Now()
// Scan for arbitrage entries using maker fees (limit orders)
makerOpps := ScanBGHL(store)
snap := store.GetAll()
makerOpps := ScanBGHL(snap)
dashboard.UpdateScan(makerOpps)
t2 := time.Now()
// Track spread window durations (how long each opportunity stays alive)
snap := store.GetAll()
spreadTracker.Tick(snap, cfg.TradeThreshold)
for _, opp := range makerOpps {