Skip to content

Conversation

@ershisan99
Copy link
Collaborator

update mmr as a single query instead of a Promise.all() creating multiple connections to the db.

don't expect anything notable, but it's a good first step towards a more global goal

=== Results ===

┌───┬───────────────────────────┬───────────────────┬──────┬──────────┬─────────────┐
│   │ Test                      │ Avg Duration (ms) │ Ops  │ Ops/sec  │ Memory (KB) │
├───┼───────────────────────────┼───────────────────┼──────┼──────────┼─────────────┤
│ 0 │ 10 players - individual   │ 416.16            │ 10   │ 24.03    │ 174.20      │
│ 1 │ 10 players - bulk         │ 42.17             │ 10   │ 237.15   │ 41.52       │
│ 2 │ 50 players - individual   │ 2129.61           │ 50   │ 23.48    │ 681.05      │
│ 3 │ 50 players - bulk         │ 44.60             │ 50   │ 1121.07  │ 70.51       │
│ 4 │ 100 players - individual  │ 4178.78           │ 100  │ 23.93    │ 1267.43     │
│ 5 │ 100 players - bulk        │ 42.98             │ 100  │ 2326.53  │ 131.76      │
│ 6 │ 500 players - individual  │ 20977.20          │ 500  │ 23.84    │ 6201.65     │
│ 7 │ 500 players - bulk        │ 76.07             │ 500  │ 6573.23  │ 576.18      │
│ 8 │ 1000 players - individual │ 42124.77          │ 1000 │ 23.74    │ 12412.24    │
│ 9 │ 1000 players - bulk       │ 86.04             │ 1000 │ 11622.61 │ 1083.53     │
└───┴───────────────────────────┴───────────────────┴──────┴──────────┴─────────────┘

=== Performance Comparison ===

10 players:
  Bulk is 9.87x faster
  Time saved: 373.99ms
  Memory diff: -132.67KB

50 players:
  Bulk is 47.75x faster
  Time saved: 2085.01ms
  Memory diff: -610.54KB

100 players:
  Bulk is 97.22x faster
  Time saved: 4135.79ms
  Memory diff: -1135.67KB

500 players:
  Bulk is 275.78x faster
  Time saved: 20901.14ms
  Memory diff: -5625.47KB

1000 players:
  Bulk is 489.60x faster
  Time saved: 42038.73ms
  Memory diff: -11328.71KB

@ershisan99 ershisan99 requested review from Casjb and robotzurg October 18, 2025 01:02
Copy link
Collaborator

@robotzurg robotzurg left a comment

Choose a reason for hiding this comment

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

Looks great!

@robotzurg robotzurg merged commit 6781e12 into main Oct 18, 2025
@robotzurg robotzurg deleted the update-player-mmr-enhancement branch October 18, 2025 02:33
robotzurg added a commit that referenced this pull request Oct 18, 2025
…-mmr-enhancement"

This reverts commit 6781e12, reversing
changes made to 7f6e945.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants