lightnode icon indicating copy to clipboard operation
lightnode copied to clipboard

Caching data spends a lot time on marshaling/unmarshaling data.

Open tok-kkk opened this issue 5 years ago • 0 comments

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 queryBlocks request, 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.

tok-kkk avatar Feb 12 '20 01:02 tok-kkk