Skip to content

Conversation

@kazimuth
Copy link
Contributor

@kazimuth kazimuth commented Jun 4, 2025

Description of Changes

NetworkRequestTracker previously was keeping all historical reducer request data, and searching through this every frame to get statistics. I've modified it to throw out much more data -- it's much faster now, but only updates every few seconds.

API

Adds new APIs.

Requires SpacetimeDB PRs

N/A

Testsuite

SpacetimeDB branch name: master

Testing

  • Tested Bitcraft. Their F9 debug menu will require an update, since we now only keep one time window of request data, rather than being able to give information about multiple windows. But it works.
  • Blackholio CI

@kazimuth
Copy link
Contributor Author

kazimuth commented Jun 4, 2025

Fixes #323

Copy link
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

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

Tested machine against BitCraft on the Windows Server machine running in editor with 1024CCU. After this fix, there is still a delay when opening the F9 menu, but once opened, there is no apparent lag from the menu being open.
This indicates to me that the values returned by the F9 menu should be far more credible with this fix. I'm marking this as approved.

@kazimuth
Copy link
Contributor Author

kazimuth commented Jun 6, 2025

@joshua-spacetime suggested we just discard the previous max every 5 seconds. I'm inclined to do that since it reduces allocator pressure. Gonna rewrite this.

@kazimuth
Copy link
Contributor Author

kazimuth commented Jun 6, 2025

Now this is rewritten to support multiple windows. Values take longer to show up for the first time, and only update every n seconds, but I think that's fine. This now uses much less time and memory. I've tested against BitCraft again and am ready to merge.

@kazimuth kazimuth merged commit 7335422 into master Jun 6, 2025
8 checks passed
@kazimuth kazimuth deleted the jgilles/faster-stats branch June 6, 2025 21:02
bfops pushed a commit that referenced this pull request Jul 28, 2025
## Description of Changes
`NetworkRequestTracker` previously was keeping all historical reducer
request data, and searching through this every frame to get statistics.
I've modified it to throw out much more data -- it's much faster now,
but only updates every few seconds.

## API

Not an API break, but deprecates an argument of one of
NetworkRequestTracker's methods to no longer do anything.

Adds new APIs.

## Requires SpacetimeDB PRs
N/A

## Testsuite

SpacetimeDB branch name: master

## Testing

- [x] Tested Bitcraft. **Their F9 debug menu will require an update,
since we now only keep one time window of request data, rather than
being able to give information about multiple windows.** But it works.
- [x] Blackholio CI
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