use a Event Cache to replace vec Events in deposit_event#2228
use a Event Cache to replace vec Events in deposit_event#2228atenjin wants to merge 2 commits intoparitytech:masterfrom
Events in deposit_event#2228Conversation
issue 2223 paritytech#2223 suggestion 1 use a map `EventsCache` to replace vec `Events` in `deposit_event`, and flush cache into `Events` on `finalize()`
|
It looks like @jkingdom signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
1 similar comment
|
It looks like @jkingdom signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
|
I still think this should be solved in |
Unless provide I think substrate should not open an O(n) storage to users, for users would access it in their way which may cast performance problem just like |
|
I agree with @jkingdom |
|
I would provide a function
So we will require just one database access for the event data. If we expect database accesses to cost more than allocating space. My solution should be fast than the current presented one. |
this is a nice solution, but it may modify all related interfaces, I think at least related to It may cast a lot of time, at now, we(ChainPool, ChainX) fork substrate to do our changes for this. |
|
Yeah for |
|
Just to give an update on this. I have made the changes to parity-codec I described above. In a benchmark I achieve a speedup of factor 366, by using my described method(benchmark is appending 1000 items to a vector like it would be done in substrate). |
|
Superseded by: #2282 |
issue 2223 #2223
suggestion 1
use a map
EventsCacheto replace vecEventsindeposit_event, and flush cache intoEventsonfinalize()