Skip to content

[bugfix] Only clean caches on table destroy#611

Merged
pzuraq merged 2 commits intomasterfrom
pzuraq/bugfix/only-clean-cache-on-table-destroy
Oct 3, 2018
Merged

[bugfix] Only clean caches on table destroy#611
pzuraq merged 2 commits intomasterfrom
pzuraq/bugfix/only-clean-cache-on-table-destroy

Conversation

@pzuraq
Copy link
Copy Markdown
Contributor

@pzuraq pzuraq commented Aug 17, 2018

Currently, whenever rows change we attempt to erase the row meta values
for rows which are no longer part of the table. This is an O(n)
operation which is fairly expensive, and we were doing it wrong as we
were not traversing children rows at all.

This PR moves the cache cleaning to only occur when the table is fully
destroyed. This means that we may hold onto meta objects longer than is
ideal, but we also won't incur an expensive operation every time the
table is updated. The alternative would be to fix the cache cleaning so
that we traverse child rows as well.

Currently, whenever rows change we attempt to erase the row meta values
for rows which are no longer part of the table. This is an O(n)
operation which is fairly expensive, and we were doing it wrong as we
were not traversing children rows at all.

This PR moves the cache cleaning to only occur when the table is fully
destroyed. This means that we may hold onto meta objects longer than is
ideal, but we also won't incur an expensive operation every time the
table is updated. The alternative would be to fix the cache cleaning so
that we traverse child rows as well.
@pzuraq pzuraq force-pushed the pzuraq/bugfix/only-clean-cache-on-table-destroy branch from 7545b76 to e0bf5cb Compare October 3, 2018 17:49
@pzuraq pzuraq merged commit 7a52e8e into master Oct 3, 2018
@pzuraq pzuraq deleted the pzuraq/bugfix/only-clean-cache-on-table-destroy branch October 3, 2018 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant