You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Hash method traverses all properties of geometric types to create their signature. This can be extremely slow, and can instead leverage the GeometryHash method(s). In particular, when we will have implemented the aggregating GeometryHash method that returns a single number (#3251), we can use it instead of this property traversal for geometric types in the main Hash method. We can expose this as the default behaviour, but also have an option in the ComparisonConfig to toggle the old property traversal behaviour for Geometric types, if required for some reason. Further, we can expose the GeometryHash optional arguments such as the translation tolerance as properties of the ComparisonConfig class.
This will greatly increase the speed (and accuracy) of the Hash method for geometric types. Further, we will be able to always use the main Hash method for all use cases – including geometric types. This would make things more consistent and simpler to use.
Looks like the great minds think alike! 😃 I had the same thought when I first learnt about GeometryHash - why aren't we calling it from the Hash method?! So yes, 100% support, especially that I do not think there is any precedent where we would persist the hashes at the moment - most users compare on the fly, i.e. if what they think is the same still comes back as the same, it is not a breaking change 👍
I had the same thought when I first learnt about GeometryHash - why aren't we calling it from the Hash method
Mainly just because we've written GeometryHash after Hash to solve a specific problem, but it was always in consideration (at least for me) to have it called from there.
if what they think is the same still comes back as the same, it is not a breaking change
I agree we shouldn't consider it a breaking change. However, it could be considered breaking of workflows were the hash has been stored as text somewhere as a "reference signature" of a set of objects. I don't think the usage is yet wide enough to warrant a worry about such cases.
Description:
This depends on #3251 .
Currently, the Hash method traverses all properties of geometric types to create their signature. This can be extremely slow, and can instead leverage the GeometryHash method(s). In particular, when we will have implemented the aggregating GeometryHash method that returns a single number (#3251), we can use it instead of this property traversal for geometric types in the main
Hash
method. We can expose this as the default behaviour, but also have an option in theComparisonConfig
to toggle the old property traversal behaviour for Geometric types, if required for some reason. Further, we can expose the GeometryHash optional arguments such as the translation tolerance as properties of theComparisonConfig
class.This will greatly increase the speed (and accuracy) of the Hash method for geometric types. Further, we will be able to always use the main Hash method for all use cases – including geometric types. This would make things more consistent and simpler to use.
Thoughts? @pawelbaran @al-fisher
The text was updated successfully, but these errors were encountered: