-
Notifications
You must be signed in to change notification settings - Fork 780
Closed
Labels
Description
Feature Request
Summary
A secret connection read call, no matter how many bytes its serving, is only reading 1024 bytes from disk as a syscall. Many packets are much larger, so we end up doing something like:
- sc.Read(10kb)
- Syscall read 1048 bytes (encrypted data frame)
- SecretConn decrypt
- Return 1024 bytes (data-component of a data frame)
- sc.Read(9kb)
So we will net do 10 syscalls for a 10kb read. Note that things like a full block part are (encoded) > 64kb, and therefore require 64 syscalls!
Proposal
Use a bufferred reader over the connection within secret connection. I tested it out on osmosis mainnet with this code: osmosis-labs@3e2254f and saw a 10% speedup to secret connection file open times. (There were relatively small blocks on osmosis at this time) TBH I was expecting a higher speedup than 10%
I'd make a PR, but the evil secret connection tests are really messy and will take some time to fix.
Reactions are currently unavailable