[Tree-widget]: Add option to get a smaller part of models tree - #1375
Conversation
There was a problem hiding this comment.
Tree-Widget benchmark
| Benchmark suite | Current: b863dd4 | Previous: 6e71184 | Deviation | Status |
|---|---|---|---|---|
categories tree creates initial filtered view for 50k items |
2528.63 ms |
2458.25 ms |
2.86% |
〰️ |
categories tree creates initial filtered view for 50k items (P95 of main thread blocks) |
1672 ms |
1697 ms |
-1.47% |
〰️ |
categories tree changing category visibility changes visibility for 50k subCategories |
9012.68 ms |
10188.05 ms |
-11.54% |
✅ |
categories tree changing category visibility changes visibility for 50k subCategories (P95 of main thread blocks) |
2591 ms |
3437 ms |
-24.61% |
✅ |
categories tree changing definition container visibility changes visibility for 50k categories |
7217.31 ms |
6316.99 ms |
14.25% |
🚨 |
categories tree changing definition container visibility changes visibility for 50k categories (P95 of main thread blocks) |
4465 ms |
3072 ms |
45.35% |
🚨 |
models tree creates initial filtered view for 50k target items |
2256.02 ms |
2350.41 ms |
-4.02% |
〰️ |
models tree creates initial filtered view for 50k target items (P95 of main thread blocks) |
203 ms |
314 ms |
-35.35% |
✅ |
models tree validates categories visibility for imodel with 50k categories |
15608.61 ms |
15935.16 ms |
-2.05% |
〰️ |
models tree validates categories visibility for imodel with 50k categories (P95 of main thread blocks) |
4291 ms |
4544 ms |
-5.57% |
〰️ |
models tree changing model visibility changes visibility for 50k elements |
49628.68 ms |
53510.4 ms |
-7.25% |
〰️ |
models tree changing model visibility changes visibility for 50k elements (P95 of main thread blocks) |
269 ms |
307 ms |
-12.38% |
〰️ |
models tree changing category visibility changes visibility for 50k elements |
49127.2 ms |
52809.22 ms |
-6.97% |
〰️ |
models tree changing category visibility changes visibility for 50k elements (P95 of main thread blocks) |
267 ms |
283 ms |
-5.65% |
〰️ |
models tree changing per-model-category override changes visibility for 50k elements |
48799.6 ms |
54634.7 ms |
-10.68% |
✅ |
models tree changing per-model-category override changes visibility for 50k elements (P95 of main thread blocks) |
248 ms |
302 ms |
-17.88% |
✅ |
models tree changing element visibility changes only parent nodes visibility with 50k elements |
51144.03 ms |
55387.59 ms |
-7.66% |
〰️ |
models tree changing element visibility changes only parent nodes visibility with 50k elements (P95 of main thread blocks) |
486 ms |
543 ms |
-10.50% |
✅ |
This comment was automatically generated by workflow using github-action-benchmark.
|
Can you explain the reasoning behind exposing this feature as
|
|
Wouldn't we want to implement that the same way
I agree it's simpler. On the other hand, I see it this way - we already have the complex
I think these two are a bit of a stretch - we can't foresee all the possible changes we may need to make to the API in the future, and I don't see why IMO, consistency is more important in this case. |
Changed |
|
Hate to ask for another rename, but what do you think about calling it |
Renamed to getSubTreePaths |
Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com>
grigasp
left a comment
There was a problem hiding this comment.
Could you add an integration test that combines sub-tree functionality with filtering? Ideally, we'd have tests for all 3 types of filtering that we support (filter text, instance focus, getFilteredPaths).
Added 5 UseModelsTree tests: one where |
closes #1319
Added a way for consumers to get only a part of models tree.
This can be achieved by providing
getSubTreePaths. It works similarly togetFilteredPathsexcept it does not interfere with default models tree filtering. Previously, if consumers wanted to achieve this, they had to define a customgetFilteredPathsfunction and there was a problem with this:By defining the
getFilteredPathsfunction, consumers override the default filtering behaviour. So if they want filtering to work as before they have to: usecreateInstanceKeyPathswithfilter, then use it withtargetItemsand combine the results.getSubTreePathssolves this issue.