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

Remove move from Tile. #4749

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Remove move from Tile. #4749

merged 1 commit into from
Feb 23, 2024

Conversation

KiterLuc
Copy link
Contributor

@KiterLuc KiterLuc commented Feb 21, 2024

This will help the memory tracking effort by removing all move constructors/assign operator for Tile, ResultTile, etc.

[SC-41591]


TYPE: NO_HISTORY
DESC: Remove move from Tile.

Copy link
Member

@teo-tsirpanis teo-tsirpanis left a comment

Choose a reason for hiding this comment

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

How would this help with the memory tracking effort? The lack of move constructors has caused problems in places like #4682 (comment).

At the very least we could delete only move assignment.

@@ -122,7 +122,7 @@ class GenericTileIO {
* @param encryption_key The encryption key to use.
* @return Status, Tile with the data.
*/
static Tile load(
static shared_ptr<Tile> load(
Copy link
Member

Choose a reason for hiding this comment

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

How about we return tdb_unique_ptr? It can avoid the overhead of shared_ptr if we don't need it, and can be converted to a shared_ptr if we need it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not a bad suggestion, but the generic tiles get passed around in our codebase and we would need extra conversions to make this work. Since a generic tile does storage access, I doubt there will be much performance impact here so let's keep it a shared pointer for now. More, at some point in the near future, we are going to fully get rid of the tile class so we can address this at that time.

Copy link

This will help the memory tracking effort by removing all move constructors/assign operator for Tile, ResultTile, etc.

---
TYPE: NO_HISTORY
DESC: Remove move from Tile.
@KiterLuc
Copy link
Contributor Author

@teo-tsirpanis The problem in #4682 is a different one, and we'll solve that one independently. Here, this is actually also a good change for other reasons... There is no reason we should be moving tiles around and in some cases, we were using the move constructor when we didn't think we were. This change will prevent us from doing that again.

Copy link
Contributor

@davisp davisp left a comment

Choose a reason for hiding this comment

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

+1 on this change. I spent some time yesterday reviewing things and then checking performance and am not finding a significant change before and after this commit.

I'll spend today getting my Tile PR rebased onto this branch and then update the ResultTile instrumentation.

@KiterLuc KiterLuc merged commit 6561589 into dev Feb 23, 2024
53 of 56 checks passed
@KiterLuc KiterLuc deleted the lr/no-tile-move branch February 23, 2024 15:43
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.

3 participants