Skip to content

perf: project imported matches to slim structs in standings import#7654

Open
Rathoz wants to merge 1 commit into
standings-tests-aifrom
standings-import-slim-match
Open

perf: project imported matches to slim structs in standings import#7654
Rathoz wants to merge 1 commit into
standings-tests-aifrom
standings-import-slim-match

Conversation

@Rathoz

@Rathoz Rathoz commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Imported matches are now projected to a StandingsImportMatch struct — {matchId, finished, winner, opponents (by ref), slim games} — at import time in Parse/Lpdb.lua. Tiebreakers (Buchholz, Game/Util, Game/Rounds/Util) are the only consumers and read exactly these fields. This drops bracketData, extradata, and full game payloads per match (big memory win on large group stages), and matchFromRecord now runs once per match2 record instead of once per (match, round).
  • mergeOpponentsData in Table.lua now uses a name-keyed opponent index (O(1) fast path, one linear-scan fallback for renamed teams via Opponent.same) and an explicit allocation-safe merge that reproduces deepMerge's output without mutating imported structures. The Table module import is removed as it is no longer needed.
  • Type annotations updated: TiebreakerOpponent.matches and StandingTableOpponentData.rounds.match/matches now reference StandingsImportMatch instead of MatchGroupUtilMatch.

How did you test this change?

  • busted --run=ci: 605 successes / 0 failures / 0 errors (standings_import_spec, standings_table_merge_spec, standings_tiebreaker_spec all pass)
  • luacheck on all three touched files: 0 warnings / 0 errors
  • Based on standings-tests-ai (PR test: add integration tests for standings #7647) whose import/merge/tiebreaker specs lock the observable semantics; no test files were modified.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Rathoz Rathoz requested review from a team as code owners June 12, 2026 15:59
@Rathoz Rathoz force-pushed the standings-import-slim-match branch from 1751355 to 29e107e Compare June 12, 2026 16:11

@hjpalpha hjpalpha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable on phone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants