iTwin / presentation

Monorepo for iTwin.js Presentation Library
https://www.itwinjs.org/presentation/
MIT License
4 stars 0 forks source link

`shared`: Fix `ECSql.createRelationshipPathJoinClause` #631

Closed grigasp closed 2 months ago

grigasp commented 2 months ago

A fix required for https://github.com/iTwin/viewer-components-react/issues/915.

Added more test cases for the function and changed existing ones to use real situations from BisCore schema.

Below are the matrices of where the navigation property should be located:

When doing a forward join:

nav prop / relationship forward backward
forward src src
backward target target

When doing a reversed join:

nav prop / relationship forward backward
forward target target
backward src src

Clearly, relationship strength direction doesn't affect this - we should look only at direction of the navigation property and whether our join is reversed or not.

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 5888d66773c9d1a482201d906a6e576bd8517ec3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages | Name | Type | | ------------------------------------- | ----- | | @itwin/presentation-shared | Patch | | @itwin/presentation-core-interop | Patch | | @itwin/presentation-hierarchies-react | Patch | | @itwin/presentation-hierarchies | Patch | | @itwin/unified-selection | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 2 months ago

Unified selection benchmark

Benchmark suite Current: 5888d66773c9d1a482201d906a6e576bd8517ec3 Previous: fa956779bdd0296f70cd116af89b9a887ab8f999 Deviation Status
hilite 50k elements 1181.91 ms 1223.35 ms -3.3874% ✅
hilite 50k elements (P95 of main thread blocks) 40 ms 67 ms -40.2985% ✅
hilite 50k group elements 230.02 ms 230.21 ms -0.0825% ✅
hilite 50k group elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
hilite 1k subjects 47559.67 ms 47168.05 ms 0.8303% 🚨
hilite 1k subjects (P95 of main thread blocks) 29 ms 30 ms -3.3333% ✅
hilite 50k subcategories 273.96 ms 279.28 ms -1.9049% ✅
hilite 50k subcategories (P95 of main thread blocks) 33 ms 33 ms 0% 🟰
hilite 50k functional 3D elements 25818.06 ms 25547.88 ms 1.0575% 🚨
hilite 50k functional 3D elements (P95 of main thread blocks) 38 ms 35 ms 8.5714% 🚨
hilite 50k functional 2D elements 6096.89 ms 6116.14 ms -0.3147% ✅
hilite 50k functional 2D elements (P95 of main thread blocks) 43 ms 31 ms 38.7097% 🚨
compute selection for 50k elements 304.94 ms 303.76 ms 0.3885% 🚨
compute selection for 50k elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute parent selection for 50k elements 348.97 ms 339.04 ms 2.9289% 🚨
compute parent selection for 50k elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute top ancestor selection for 50k elements 562.56 ms 560.18 ms 0.4249% 🚨
compute top ancestor selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute category selection for 50k elements 100.34 ms 90.92 ms 10.3608% 🚨
compute category selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute model selection for 50k elements 76.42 ms 76.26 ms 0.2098% 🚨
compute model selection for 50k elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute functional selection for 50k 3D elements 398.5 ms 400.11 ms -0.4024% ✅
compute functional selection for 50k 3D elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute parent functional selection for 50k 3D elements 451.5 ms 449.41 ms 0.4651% 🚨
compute parent functional selection for 50k 3D elements (P95 of main thread blocks) 31 ms 31 ms 0% 🟰
compute top ancestor functional selection for 50k 3D elements 1162.9 ms 1172.86 ms -0.8492% ✅
compute top ancestor functional selection for 50k 3D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute functional selection for 50k 2D elements 3026.29 ms 3019.69 ms 0.2186% 🚨
compute functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute parent functional selection for 50k 2D elements 2999.79 ms 3052.29 ms -1.7200% ✅
compute parent functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
compute top ancestor functional selection for 50k 2D elements 3022.49 ms 3049.66 ms -0.8909% ✅
compute top ancestor functional selection for 50k 2D elements (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨

This comment was automatically generated by workflow using github-action-benchmark.

github-actions[bot] commented 2 months ago

Hierarchies benchmark

Benchmark suite Current: 5888d66773c9d1a482201d906a6e576bd8517ec3 Previous: fa956779bdd0296f70cd116af89b9a887ab8f999 Deviation Status
flat 50k elements list 4210.05 ms 4174.27 ms 0.8572% 🚨
flat 50k elements list (P95 of main thread blocks) 72 ms 72 ms 0% 🟰
grouping by label 10238.62 ms 10384.27 ms -1.4026% ✅
grouping by label (P95 of main thread blocks) 58 ms 61 ms -4.9180% ✅
grouping by class 10362.12 ms 10430.72 ms -0.6577% ✅
grouping by class (P95 of main thread blocks) 43 ms 50 ms -14.0000% ✅
grouping by property 11153.88 ms 10906.77 ms 2.2657% 🚨
grouping by property (P95 of main thread blocks) 45 ms 51 ms -11.7647% ✅
grouping by base class (10 classes) 7656.94 ms 7597.89 ms 0.7772% 🚨
grouping by base class (10 classes) (P95 of main thread blocks) 79 ms 86 ms -8.1395% ✅
grouping by multiple attributes 28126.59 ms 28016.06 ms 0.3945% 🚨
grouping by multiple attributes (P95 of main thread blocks) 70 ms 51 ms 37.2549% 🚨
hide if no children required to finalize root, w/o children 46977.36 ms 47960.65 ms -2.0502% ✅
hide if no children required to finalize root, w/o children (P95 of main thread blocks) 40 ms 39 ms 2.5641% 🚨
hide if no children required to finalize root, w/ children 157.82 ms 165.45 ms -4.6117% ✅
hide if no children required to finalize root, w/ children (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree initial (Baytown) 39.72 ms 39.16 ms 1.4300% 🚨
models tree initial (Baytown) (P95 of main thread blocks) 0 ms 0 ms NaN% 🚨
models tree full (Baytown) 7591.23 ms 7647.45 ms -0.7351% ✅
models tree full (Baytown) (P95 of main thread blocks) 87 ms 91 ms -4.3956% ✅

This comment was automatically generated by workflow using github-action-benchmark.