Skip to content

Offline: Only enable DuplicateBatchDetector if Offline Load is enabled#22497

Merged
markfields merged 10 commits into
microsoft:mainfrom
markfields:o3/duplicates-telemetry
Sep 13, 2024
Merged

Offline: Only enable DuplicateBatchDetector if Offline Load is enabled#22497
markfields merged 10 commits into
microsoft:mainfrom
markfields:o3/duplicates-telemetry

Conversation

@markfields
Copy link
Copy Markdown
Member

@markfields markfields commented Sep 13, 2024

Description

Related to AB#8885

DuplicateBatchDetection maintains a datastructure of all batchIds/sequenceNumbers within the collab window (seqNum > latest MSN), and checks all incoming batchIds against that set. However, until Offline Load is enabled, there will be no duplicate batchIds. So until then, don't bother with this tracking.

Notes about performance

For whenever it is enabled

A simple benchmark shows that the time spent doing DuplicateBatchDetection is not much - around 30ms for data structure size of 1000, which is 99.99%ile collab window in the production data I looked at.

To me this seems acceptable - and more importantly, predictable (in terms of perf characteristics, based on the data structures/algorithms used) - so I don't see benefit in instrumenting the code (which would only slow it down). I tried using SampledTelemetryHelper in this branch (3bf6045) but decided it wasn't worth it (per this analysis)

@github-actions github-actions Bot added area: runtime Runtime related issues base: main PRs targeted against main branch labels Sep 13, 2024
@msfluid-bot
Copy link
Copy Markdown
Collaborator

msfluid-bot commented Sep 13, 2024

@fluid-example/bundle-size-tests: +345 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 459.93 KB 459.99 KB +60 Bytes
azureClient.js 557.86 KB 557.93 KB +74 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 260.69 KB 260.73 KB +39 Bytes
fluidFramework.js 401.54 KB 401.55 KB +14 Bytes
loader.js 134.19 KB 134.2 KB +14 Bytes
map.js 42.43 KB 42.44 KB +7 Bytes
matrix.js 146.58 KB 146.58 KB +7 Bytes
odspClient.js 525.21 KB 525.28 KB +74 Bytes
odspDriver.js 97.8 KB 97.82 KB +21 Bytes
odspPrefetchSnapshot.js 42.76 KB 42.78 KB +14 Bytes
sharedString.js 163.3 KB 163.31 KB +7 Bytes
sharedTree.js 392 KB 392.01 KB +7 Bytes
Total Size 3.3 MB 3.3 MB +345 Bytes

Baseline commit: 819cafa

Generated by 🚫 dangerJS against ea554f8

Comment thread packages/runtime/container-runtime/src/containerRuntime.ts Outdated
@markfields markfields enabled auto-merge (squash) September 13, 2024 21:29
@markfields markfields merged commit de91c3a into microsoft:main Sep 13, 2024
@markfields markfields deleted the o3/duplicates-telemetry branch September 13, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: runtime Runtime related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants