lightnode
lightnode copied to clipboard
Caching data spends a lot time on marshaling/unmarshaling data.
Currently, the cacher of lightnode is using a TTL table of kv. It will marshal/unmarshal when write/read the response. Since the response can be really big, marshal/unmarshal is really expensive in this case.
For a
queryBlocksrequest, the response can be 6- 10MB. A single read/write will take 0.2-0.3 seconds.
The best best solution I can think of is to have a TTL implementation of the bounded map which don't do marshaling/unmarshaling when wirte/read.