Skip to content
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

chore(Communities/InDropdown): Performance improved #14302

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

micieslak
Copy link
Member

@micieslak micieslak commented Apr 5, 2024

What does the PR do

LeftJoinModel:

  • Added possibility to explicitly define roles to be joined. That's especially needed when models is joined to itself as in the case of InDropdown.
  • Added checks to componentComplete - early attempts to initialize proxy may fail bc left/right models may be not ready when they are set. It may lead to a situation where the model remains uninitialized and reporint 0 row count.

InDropdown:

  • significant performance boost (from several seconds lag to milliseconds)
  • removed multiple filtering separately for each category
  • no instantiation of all delegates up front (regular ListView approach
    used)
  • fixed category selection when filtering - selecting/deselecting only
    items fulfilling search criteria
  • significant simplification of the code

Closes: #14298
Closes: #14275

Affected areas

LeftJoinModel, InDropdown

Screenshot of functionality (including design for comparison)

Kazam_screencast_00104.webm

…es to be joined

The new property is added to allow indicating which roles from the right
model should be used. It prevents from unnecessary renamings.

Closes: #14298
Earier attempts to initialize proxy may fail bc left/right models
may be not ready when they are set. It may lead to a situation where
the model remains uninitialized and reporint 0 row count.
- removed multiple filtering separately for each category
- no instantiation of all delegates up front (regular ListView approach
  used)
- fixed category selection when filtering - selecting/deselecting only
  items fulfilling search criteria
- significant simplification of the code

Closes: #14275
@status-im-auto
Copy link
Member

status-im-auto commented Apr 5, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f9b33e2 #1 2024-04-05 11:12:25 ~6 min macos/aarch64 🍎dmg
✔️ f9b33e2 #1 2024-04-05 11:12:50 ~6 min tests/nim 📄log
f9b33e2 #1 2024-04-05 11:17:15 ~11 min tests/ui 📄log
✔️ f9b33e2 #1 2024-04-05 11:18:45 ~12 min macos/x86_64 🍎dmg
✔️ f9b33e2 #1 2024-04-05 11:23:19 ~17 min linux/x86_64 📦tgz
✔️ f9b33e2 #1 2024-04-05 11:37:17 ~31 min windows/x86_64 💿exe
✔️ f9b33e2 #2 2024-04-05 12:17:15 ~7 min tests/ui 📄log

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, just 2 comments inline

qWarning().noquote()
<< QString("Role to join %1 not found in the right model!")
.arg(roleName);
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it just continue here with the next role?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think that both variants are ok. This one is more strict and kind of fail-fast approach. If you declared roles it's presumed that you really need them, otherwise proxy won't be initialized.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd still like to see the continue here, just to be more resilitent to backend model changes (e.g. when an unused role gets dropped)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't perceive it as resilience - rather easy way to overlook subtle bugs. If model is not initialized it should be easily detected by e.g. high-level squish tests bc it won't be possible to set channels and complete permission flow using channels. If the role is silently skipped it may easily introduce long-lasting small bug in the ui like e.g. incorrect names rendering.

I can change it if you insist but please consider all pros/cons here :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fair enough, I think it's good to stay on the conservative side 😊

Copy link
Contributor

@noeliaSD noeliaSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM and tested! Great performance improvement, it's really noticeable!

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work overall, nice speedup!

@micieslak micieslak merged commit a83f111 into master Apr 5, 2024
8 checks passed
@micieslak micieslak deleted the feat/issue-14298-14275 branch April 5, 2024 12:58
@noeliaSD
Copy link
Contributor

noeliaSD commented Apr 8, 2024

@caybro @micieslak , something to include on this pr??

@caybro
Copy link
Member

caybro commented Apr 8, 2024

@caybro @micieslak , something to include on this pr??

Yup, will add it

@caybro
Copy link
Member

caybro commented Apr 8, 2024

@caybro @micieslak , something to include on this pr??

Yup, will add it

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants