perf/portfolio-enricher-optimization #9

Merged
ksv741 merged 2 commits from perf/portfolio-enricher-optimization into main 2026-06-14 13:43:06 +03:00

2 Commits

Author SHA1 Message Date
38729249f3 fix: exclude test files from frontend tsc build
All checks were successful
CI / lint (pull_request) Successful in 1m46s
CI / test (pull_request) Successful in 1m48s
CI / build (pull_request) Successful in 1m56s
CI / lint (push) Successful in 1m51s
CI / test (push) Successful in 1m51s
CI / build (push) Successful in 1m46s
Test files use vitest globals (vi, describe, afterEach) not available
to tsc. Exclude them from build type-check via tsconfig exclude block.
2026-06-14 13:41:17 +03:00
60e456fbb5 perf: reduce portfolio enrichment from 298 to 2 MOEX API calls (-99.3%)
Three optimizations:
1. Merge getBondData + getBondMarketData into single batch call
   (same endpoint, parse both tables)
2. Remove redundant getSecurityDescription for shortName
   (shortName already in market data responses)
3. Batch by market: 1 call for all shares, 1 call for all bonds
   (instead of N individual calls)

Before: 298 API calls for 104 positions -> ~29.8s
After:  2 API calls for 104 positions -> ~0.3s
2026-06-14 13:19:22 +03:00