Skip to content

Measure state sync congestion #661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged

Measure state sync congestion #661

merged 2 commits into from
Apr 7, 2025

Conversation

pblazej
Copy link
Contributor

@pblazej pblazej commented Apr 7, 2025

  • Adds os.signpost capabilities
  • Adds LK_SIGNPOSTS flag that you need to .define in your SPM vs redirecting logs to /dev/null (OSLog.disabled) - to avoid unexpected behavior/perf penalty
  • The only awkward thing is subscript() as we cannot alter the signature here
  • Dumps the results per file/area like so (macOS):

image

Copy link

ilo-nanpa bot commented Apr 7, 2025

it seems like you haven't added any nanpa changeset files to this PR.

if this pull request includes changes to code, make sure to add a changeset, by writing a file to .nanpa/<unique-name>.kdl:

minor type="added" "Introduce frobnication algorithm"

refer to the manpage for more information.

@pblazej
Copy link
Contributor Author

pblazej commented Apr 7, 2025

On iOS, it's "slower", shows some more anomalies, like:

image

@pblazej pblazej requested a review from hiroshihorie April 7, 2025 11:41
@pblazej
Copy link
Contributor Author

pblazej commented Apr 7, 2025

Eventual "fixes" should come in separate PRs 😢

public final class StateSync<State>: @unchecked Sendable, Loggable {
// MARK: - Logging

#if LK_SIGNPOSTS
Copy link
Contributor Author

@pblazej pblazej Apr 7, 2025

Choose a reason for hiding this comment

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

If that's too awkward to read, we can use the .disabled pattern as suggested here https://developer.apple.com/videos/play/wwdc2018/405/ + launch args.

But let's be careful with video critical path here...

@hiroshihorie
Copy link
Member

This is great 🙏

@pblazej pblazej merged commit 33542ab into main Apr 7, 2025
20 checks passed
@pblazej pblazej deleted the blaze/lock-signpost branch April 7, 2025 13:33
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.

2 participants