Skip to content
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

fix(core): merge in listenerEvents in _keepalive stream #8122

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

bjoerge
Copy link
Member

@bjoerge bjoerge commented Dec 20, 2024

Description

Small follow up from #8120 – I mistakenly thought subscribing to commit stream was sufficient because I thought it built upon the listener, but turns out it wasn't so. This fix merges in listener stream with _keepalive.

What to review

The review procedure from #8120 should still hold water:

  • Navigate to a document (A) in the Studio
  • Make sure there is a single event source set up with the tag sanity.studio.document.pair-listener
  • Navigate to another document (B)
  • Make sure there is a single new event source set up with the tag sanity.studio.document.pair-listener
  • Go back to document A before 10s has passed
  • Verify that no request was made with the tag sanity.studio.document.pair-listener
  • Stay on document A for more than 10s
  • Verify that the listener connection made for document B is now shut down (timing panel no longer says "Caution: request is not finished yet!")
  • Now, going back to B should trigger a new listener connection again.

Notes for release

n/a

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
page-building-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 2:31pm
performance-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 2:31pm
test-next-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 2:31pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 2:31pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Dec 20, 2024 2:31pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

⚡️ Editor Performance Report

Updated Fri, 20 Dec 2024 14:22:18 GMT

Benchmark reference
latency of sanity@latest
experiment
latency of this branch
Δ (%)
latency difference
article (title) 27.0 efps (37ms) 27.4 efps (37ms) -1ms (-1.4%)
article (body) 78.1 efps (13ms) 78.1 efps (13ms) +0ms (-/-%)
article (string inside object) 28.2 efps (36ms) 29.4 efps (34ms) -2ms (-4.2%)
article (string inside array) 23.8 efps (42ms) 26.3 efps (38ms) -4ms (-9.5%)
recipe (name) 55.6 efps (18ms) 55.6 efps (18ms) +0ms (-/-%)
recipe (description) 62.5 efps (16ms) 69.0 efps (15ms) -2ms (-9.4%)
recipe (instructions) 99.9+ efps (5ms) 99.9+ efps (5ms) +0ms (-/-%)
synthetic (title) 18.5 efps (54ms) 20.0 efps (50ms) -4ms (-7.4%)
synthetic (string inside object) 18.0 efps (56ms) 19.6 efps (51ms) -5ms (-8.1%)

efps — editor "frames per second". The number of updates assumed to be possible within a second.

Derived from input latency. efps = 1000 / input_latency

Detailed information

🏠 Reference result

The performance result of sanity@latest

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 37ms 54ms 64ms 546ms 836ms 10.0s
article (body) 13ms 15ms 17ms 163ms 188ms 4.7s
article (string inside object) 36ms 38ms 40ms 79ms 128ms 6.4s
article (string inside array) 42ms 44ms 51ms 311ms 375ms 7.3s
recipe (name) 18ms 19ms 21ms 29ms 0ms 6.7s
recipe (description) 16ms 18ms 21ms 32ms 0ms 4.4s
recipe (instructions) 5ms 7ms 8ms 13ms 0ms 3.0s
synthetic (title) 54ms 57ms 64ms 112ms 246ms 12.5s
synthetic (string inside object) 56ms 60ms 70ms 486ms 1039ms 8.9s

🧪 Experiment result

The performance result of this branch

Benchmark latency p75 p90 p99 blocking time test duration
article (title) 37ms 39ms 56ms 422ms 159ms 9.7s
article (body) 13ms 15ms 19ms 70ms 184ms 4.7s
article (string inside object) 34ms 35ms 39ms 109ms 231ms 6.4s
article (string inside array) 38ms 41ms 47ms 82ms 132ms 6.6s
recipe (name) 18ms 20ms 22ms 38ms 0ms 6.3s
recipe (description) 15ms 16ms 19ms 36ms 0ms 4.2s
recipe (instructions) 5ms 7ms 8ms 9ms 0ms 3.0s
synthetic (title) 50ms 53ms 59ms 292ms 509ms 12.3s
synthetic (string inside object) 51ms 53ms 64ms 278ms 833ms 8.3s

📚 Glossary

column definitions

  • benchmark — the name of the test, e.g. "article", followed by the label of the field being measured, e.g. "(title)".
  • latency — the time between when a key was pressed and when it was rendered. derived from a set of samples. the median (p50) is shown to show the most common latency.
  • p75 — the 75th percentile of the input latency in the test run. 75% of the sampled inputs in this benchmark were processed faster than this value. this provides insight into the upper range of typical performance.
  • p90 — the 90th percentile of the input latency in the test run. 90% of the sampled inputs were faster than this. this metric helps identify slower interactions that occurred less frequently during the benchmark.
  • p99 — the 99th percentile of the input latency in the test run. only 1% of sampled inputs were slower than this. this represents the worst-case scenarios encountered during the benchmark, useful for identifying potential performance outliers.
  • blocking time — the total time during which the main thread was blocked, preventing user input and UI updates. this metric helps identify performance bottlenecks that may cause the interface to feel unresponsive.
  • test duration — how long the test run took to complete.

Copy link
Contributor

Component Testing Report Updated Dec 20, 2024 2:22 PM (UTC)

❌ Failed Tests (2) -- expand for details
File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 1m 5s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ❌ Failed (Inspect) 1m 18s 5 0 1
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 50s 11 7 0
formBuilder/inputs/PortableText/copyPaste/CopyPasteFields.spec.tsx ✅ Passed (Inspect) 0s 0 12 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/DisableFocusAndUnset.spec.tsx ✅ Passed (Inspect) 14s 3 0 0
formBuilder/inputs/PortableText/DragAndDrop.spec.tsx ✅ Passed (Inspect) 27s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 1m 7s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 28s 21 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 41s 18 0 0
formBuilder/inputs/PortableText/PresenceCursors.spec.tsx ✅ Passed (Inspect) 13s 3 9 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 26s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ❌ Failed (Inspect) 2m 23s 20 0 1
formBuilder/tree-editing/TreeEditing.spec.tsx ✅ Passed (Inspect) 0s 0 3 0
formBuilder/tree-editing/TreeEditingNestedObjects.spec.tsx ✅ Passed (Inspect) 0s 0 3 0

@bjoerge bjoerge marked this pull request as ready for review December 20, 2024 15:34
@bjoerge bjoerge requested a review from a team as a code owner December 20, 2024 15:34
@bjoerge bjoerge requested review from ricokahler and stipsan and removed request for a team December 20, 2024 15:34
@bjoerge bjoerge added this pull request to the merge queue Dec 20, 2024
Merged via the queue into next with commit 498b7e4 Dec 20, 2024
57 checks passed
@bjoerge bjoerge deleted the fix/delayed-unsubscribe branch December 20, 2024 15:38
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