Diffing_Engine: profiling
- Dominant language
- C#
- Stars
- 30
- Forks
- 13
- Avg merge
- 7d 10h
- Merged PRs (30d)
- 5
Description
Create profiling tests and record results.
I will edit this post with added tests.
# ProfilingTest_01 - bars only
Test file: https://github.com/BHoM/BHoM_Engine/blob/Diffing_Engine-initialImplementation/Engine_Test/Diffing_Engine/Profiling01.cs
## Execution time
Here I'm testing `BH.oM.Structure.Bars` only.

Collection-level diffing only:
- From 10 to 20000 elements the algorithm seems to have an efficiency of `O(n log n)`.
- Numbers larger than 20000 the efficiency drops: haven't let it run yet but I fear much more than that.
Collection AND Property-level diffing :
- Efficiency much lower, close to `n²` for relatively small numbers (5000).
## Cpu profile
* A big, probably unnecessary performance hit is caused by how we are forced to retrieve a specific fragment:

This might be food for thought on how we implemented the Fragments.
* However, the largest percentage is lost in the following section, which I can definitely improve

### Conclusions
- There is definitely room for improvement. I can rewrite code to make it more efficient, for now I only wanted to finish the prototype.
- What if I used CustomData instead of Fragment to save the hashes? Just getting the right fragment has a certain cost.
# Other profiling tests
Other tests are needed to account for different cases:
- types of elements: elements with a deep/complex/heavy class structure (Panels? Meshes?)
- variety of elements: mixed types
- others to be defined
Contributor guide
Assessment
This issue has not been assessed yet.