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

perf: improved performance of TabularDataset.__eq__ by a factor of up to 2 #697

Merged
merged 5 commits into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/safeds/data/labeled/containers/_tabular_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __eq__(self, other: object) -> bool:
return NotImplemented
if self is other:
return True
return self.target == other.target and self.features == other.features and self._table == other._table
return self.target == other.target and self.features == other.features and self._extras == other._extras

def __hash__(self) -> int:
"""
Expand All @@ -105,7 +105,7 @@ def __hash__(self) -> int:
hash:
The hash value.
"""
return _structural_hash(self.target, self.features, self._table)
return _structural_hash(self.target, self.features, self._extras)

def __sizeof__(self) -> int:
"""
Expand All @@ -116,7 +116,7 @@ def __sizeof__(self) -> int:
size:
Size of this object in bytes.
"""
return sys.getsizeof(self._target) + sys.getsizeof(self._features) + sys.getsizeof(self._table)
return sys.getsizeof(self._target) + sys.getsizeof(self._features) + sys.getsizeof(self._extras)

# ------------------------------------------------------------------------------------------------------------------
# Properties
Expand Down