frequency-chain / frequency

Frequency: A Polkadot Parachain
https://www.frequency.xyz
Apache License 2.0
48 stars 18 forks source link

Ideas for Improvements and Optimizations #59

Open wilwade opened 2 years ago

wilwade commented 2 years ago

This is an issue to keep track of ideas around improvements and optimizations that we might want to do, but getting to alpha first is priority.

General

Schema Related

Message Storage Related

Message Retrieval Related

Batch Related

Parallelization

CI

saraswatpuneet commented 2 years ago
aramikm commented 2 years ago

We should consider removing all the events and just do off-chain websocket event filter registrations.

I'd like to know more about this. I did some benchmarks and it seems like events are not considered a DB write. So I think the overhead is on writing of the block since they are part of the block properties.

enddynayn commented 2 years ago

@aramikm I think they are considered a DB write. Their impact might not be noticeable because perhaps we are not setting up the state in the benchmark.

I read that events are pruned after every block so the cost is not compounding. Also, since caching is done, it might be just one read and write per block?

https://github.com/paritytech/substrate/blob/master/frame/system/src/lib.rs#L597

Found where events are pruned after every block: https://stackoverflow.com/questions/57219830/what-is-the-cost-of-event-storage-in-substrate

aramikm commented 2 years ago

@enddynayn yeah, in that case we need to be really careful about how our benchmarks are setup, since there might be some hidden costs that are not reflected there.