Open richburdon opened 4 years ago
related: https://github.com/dxos/sdk/pull/12
related: https://github.com/dxos/sdk/pull/27
Notes on running:
Test:
Setup:
$ cd sdk
$ yarn
$ yarn build
Run:
$ cd testing/spawn-testing
$ yarn example
yarn run v1.22.4
$ npm run build && DEBUG="dxos:spawn-testing*" node example.js
> @dxos/spawn-testing@1.0.0-beta.121 build /home/david/projects/wireline/sdk/testing/spawn-testing
> npm run clean && babel ./src --out-dir ./dist/es --ignore "**/*.test.js" --source-maps inline
> @dxos/spawn-testing@1.0.0-beta.121 clean /home/david/projects/wireline/sdk/testing/spawn-testing
> rm -rf dist
Successfully compiled 8 files with Babel (536ms).
dxos:spawn-testing:signal discovery-swarm-webrtc running on 4000
dxos:spawn-testing:signal +0ms
dxos:spawn-testing:example > signal started +0ms
dxos:spawn-testing:example > peer0 created +516ms
dxos:spawn-testing:example > party created 2f6c2edaa2873e9c0eb4a377b9449b82932a2eb84ed0d173006cda719f12d545 +33ms
dxos:spawn-testing:example > peer1 created +527ms
dxos:spawn-testing:example > invitation created +3ms
dxos:spawn-testing:example > peer1 joined to the party +214ms
dxos:spawn-testing:example > peer2 created +545ms
dxos:spawn-testing:example > invitation created +4ms
.
.
.
Results:
dxos:spawn-testing:peer +15ms
dxos:spawn-testing:peer model-update client=7d57ff messages=106 total=1000
dxos:spawn-testing:peer +6ms
dxos:spawn-testing:example > sync successful +8s
sync: 8429.868ms
Done in 17.61s.
Sync time, ms / batch size, messages
Spawn two agents in chrome. One writes a bunch of messages. Wait for the other agent to process all of them. Measure the time elapsed. Repeat with bigger and bigger batches
Logs pastebin: https://pastebin.com/7DS8rAmC
Notice how after we pass ~10 messages we see the issue with only one message being delivered at first, and then the rest. This also coincides with around 2x jump in sync time.
Close-up on the lower ranges:
Test-runner app (or script?) to spawn signal server and spawn N clients (as separate processes) that connect to a party and replicate.
Spec
options
object to each client)Tests
DefaultModel
pushing as much messages as possibleDefaultModel
writing and another one readingObjectModel
randomly creating, mutatingNext
browser-runner