-
Notifications
You must be signed in to change notification settings - Fork 14
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
Diffing_Engine: Hash and Diff to leverage new GeometryHash #3268
Diffing_Engine: Hash and Diff to leverage new GeometryHash #3268
Conversation
Faces get included in the HashArray only if: 1) they were not specified as a TypeException, and 2) a TypeException for Point was specified. This is required because if both conditions are true, then at least "topological" information is included in the HashArray.
7c10de6
to
a8f4631
Compare
@BHoMBot check compliance |
@pawelbaran to confirm, the following actions are now queued:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff @alelom, although not trivial to keep track of 🤯 I did my best to review it properly and took the following steps:
- read the code changes - see comments, pardon my ignorance if any of them does not make sense, a few points are based more on intuition rather than in-depth debugging
- ran GH test scripts I have built for this concept on previous occasions - all passed
Test failures are gone after switching to the right branch in the diffing test repo, apologies and thanks for help @alelom! |
Co-authored-by: Pawel Baran <pawel.baran@burohappold.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to approve following code review, testing and offline discussions with @alelom. Good stuff, thanks!
@BHoMBot check required |
@alelom to confirm, the following actions are now queued:
|
@FraserGreenroyd to confirm, the following actions are now queued:
|
@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: unit-tests |
@FraserGreenroyd I have provided neutral checks to the checks requested. These checks will need to be run properly to obtain full results. |
@alelom just to let you know, I have provided a |
NOTE: Depends on
BHoM/BHoM#1594
Issues addressed by this PR
Closes #3255
Closes #3269
The following was also implemented in this PR in order to be able to test properly the implementation of #3255.
Closes #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:Profiling results, running the
DiffingProfiling
projectThe profiling considered an average use case with a mixture of geometrical and non-geometrical objects.
develop
):This profiling was repeated 20 times and gives an average value of about 33% less time.
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 #3257, but calling
BH.Engine.Base.Hash()
instead ofBH.Engine.Geometry.GeometryHash()
.Please also run all tests in BHoM/DiffingTests_Prototypes#18.
They should all pass. Please note that the default value of the new GeometryHash option is set to
true
in the ComparisonConfig (see BHoM/BHoM#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.