Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cache mem sync mutations #1431

Merged
merged 4 commits into from
Jun 29, 2023
Merged

feat: cache mem sync mutations #1431

merged 4 commits into from
Jun 29, 2023

Conversation

jyeshe
Copy link
Member

@jyeshe jyeshe commented Jun 28, 2023

Why

refs #1389 and event dry-running might take some seconds

What

It caches not only the events but the mutations to avoid reprocessing during mem sync.

@jyeshe jyeshe self-assigned this Jun 28, 2023
@jyeshe
Copy link
Member Author

jyeshe commented Jun 28, 2023

Timings ({first_height, last_height, mutations cache size, Block.blocks_mutations time in milliseconds)}:
{792253, 792254, 556526, 5500}
{792253, 792254, 557988, 219}
{792253, 792254, 559277, 219}
{792253, 792254, 560202, 218}
{792253, 792254, 560954, 208}
{792253, 792254, 561706, 212}
{792253, 792254, 562864, 208}
{792253, 792254, 563616, 212}
{792254, 792255, 435029, 4355}
{792254, 792255, 436187, 198}
{792254, 792255, 436360, 196}
{792256, 792257, 242273, 2159}
{792256, 792257, 242852, 112}
{792256, 792257, 243025, 119}
{792256, 792257, 243198, 110}
{792256, 792257, 243604, 124}
{792256, 792257, 244183, 127}
{792256, 792257, 244356, 115}
{792257, 792258, 211909, 2016}
{792257, 792258, 213023, 93}
{792257, 792258, 213196, 86}
{792257, 792258, 213369, 85}
{792257, 792258, 213542, 81}
{792257, 792258, 213948, 87}
{792257, 792258, 214527, 87}
{792257, 792258, 214700, 78}
{792257, 792258, 214873, 87}
{792257, 792258, 215279, 91}
{792257, 792258, 215858, 94}
{792257, 792258, 216226, 93}
{792257, 792258, 216399, 82}
{792257, 792258, 216978, 90}
{792257, 792258, 217151, 87}
{792257, 792258, 217557, 82}

@@ -0,0 +1,81 @@
defmodule AeMdw.BlocksTest do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This throws a warning about redefining a module

@@ -0,0 +1,81 @@
defmodule AeMdw.Sync.BlockTest do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this map the module that it is testing? AeMdw.Db.Sync.Block => AeMdw.Db.Sync.BlockTest

@jyeshe jyeshe requested a review from sborrazas June 29, 2023 13:05
@jyeshe jyeshe merged commit 5a8a36c into master Jun 29, 2023
7 checks passed
@jyeshe jyeshe deleted the mb-mutations-cache branch June 29, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants