Closed alelom closed 7 months ago
@BHoMBot check compliance
Test failures are gone after switching to the right branch in the diffing test repo, apologies and thanks for help @alelom!
@BHoMBot check required
@BHoMBot check copyright-compliance @BHoMBot check dataset-compliance
@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: unit-tests
NOTE: Depends on
https://github.com/BHoM/BHoM/pull/1594
Issues addressed by this PR
Closes https://github.com/BHoM/BHoM_Engine/issues/3255 Closes #3269
The following was also implemented in this PR in order to be able to test properly the implementation of #3255. Closes https://github.com/BHoM/BHoM_Engine/issues/3264
This PR makes the base
Hash()
use theGeometryHash()
method by default (and consequently, the Diffing can also leverage it via theDiffWithHash()
method). This can give a significant speed boost for an average of 33% less computation time, and a potential 99% for heavy geometry inputs. The average 33% speed improvement was measured via the DiffingTests_PrototypesDiffProfiling
project and the results are as below:In order to make this possible, the
BH.Engine.Geometry.Query.HashArray()
method now makes use of theBaseComparisonConfig
options, bringing it on par to the baseBH.Engine.Base.Query.Hash()
method in terms of identification potential for Geometry objects. This is a requirement for any method that return an object signature (Hash). See #3269 for more information.Test files
Same tests used in https://github.com/BHoM/BHoM_Engine/pull/3257, but calling
BH.Engine.Base.Hash()
instead ofBH.Engine.Geometry.GeometryHash()
.Please also run all tests in https://github.com/BHoM/DiffingTests_Prototypes/pull/18. They should all pass. Please note that the default value of the new GeometryHash option is set to
true
in the ComparisonConfig (see https://github.com/BHoM/BHoM/pull/1594). The fact that all tests pass in the DiffingTests_Prototypes means that the new GeometryHash integration is fully compatible with theHash()
andDiffing()
workflows and gives the same results, while also giving a performance boost.Changelog
BH.Engine.Base.Query.Hash()
method now leverages theBH.Engine.Geometry.Query.GeometryHash()
method by default. This can give a significant speed boost, for an average of 33% less computation time, and a potential 99% for heavy geometry inputs.BH.Engine.Geometry.Query.HashArray()
method now makes use of theBaseComparisonConfig
options, bringing it on par to the baseBH.Engine.Base.Query.Hash()
method in terms of identification potential for Geometry objects.