mafintosh / mafintosh/hyperlog
sync performance over websocket
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 469
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying out hyperlog with a simple muti-client to server test app. I'm syncing a simple log of JSON data.
I'm using it something like this:
```js
// client
import Hyperlog from 'hyperlog'
const log = Hyperlog (memdb, { valueEncoding: 'json' })
import WsStream from 'websocket-stream'
const stream = WsStream (`ws://${window.location.host}/socket`)
const replica = log.replicate ({ live: true })
replica.pipe (stream).pipe (replica)
// server
import Hyperlog from 'hyperlog'
const log = Hyperlog (memdb, { valueEncoding: 'json' })
import WsStream from 'websocket-stream'
const streamServer = WsStream.createServer ({ server, path: '/socket' }, stream => {
const replica = log.replicate ({ live: true })
stream.pipe (replica).pipe (stream)
})
```
I'm surprised that syncing a log of about 200 items from the server to a new client requires almost a thousand messages between the client and server, taking 20 seconds to finish replication on my laptop.
Is your library designed for this kind of application? How am I using it wrong?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named. Start by reproducing the JavaScript client/server websocket-stream setup with a 200-item JSON log, then trace replication message exchange and timing. Done means determining whether this is expected usage or a hyperlog performance defect and documenting a concrete, reproducible finding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- distributed-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100