FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Speed up string parsing in ODSP binary snapshot flow

Open vladsud opened this issue 2 years ago • 1 comments

Shows ~ 25% improvement for structure parsing part, or about 10% overall improvement. The only risk here - strings containing zeros, and possibly some differences in parsing code (browser vs. node) how zeros are handled.

Also converting recursion into loop. By itself it does not buy us much, but it localizes all parsing code in one function, which is big plus.

Other changes:

  • Propagated logger through layers
  • Simplified a bit APIs and removed unneeded exports

vladsud avatar Sep 21 '22 19:09 vladsud

@fluid-example/bundle-size-tests: +1.08 KB
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 397.39 KB 397.39 KB No change
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 196.33 KB 196.33 KB No change
loader.js 153.74 KB 153.74 KB No change
map.js 42.89 KB 42.89 KB No change
matrix.js 131.83 KB 131.83 KB No change
odspDriver.js 151.26 KB 151.8 KB +554 Bytes
odspPrefetchSnapshot.js 39.34 KB 39.88 KB +551 Bytes
sharedString.js 153.04 KB 153.04 KB No change
Total Size 1.27 MB 1.27 MB +1.08 KB

Baseline commit: dc536059677bca0cf636cef1d7072a589451ef46

Generated by :no_entry_sign: dangerJS against 829d3655ea29730ef4ea8efb97020a070bc0613b

msfluid-bot avatar Sep 21 '22 20:09 msfluid-bot

This commit is queued for merging with the next branch! Please ignore this PR for now. Contact @microsoft/fluid-cr-infra for help.

github-actions[bot] avatar Sep 23 '22 20:09 github-actions[bot]