Bug 429855

Summary: Emoji chooser window doesn't open quickly enough
Product: [Plasma] plasmashell Reporter: Alex <allo>
Component: Emoji SelectorAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: nanabaahgyan, nate
Priority: NOR    
Version: 5.20.3   
Target Milestone: 1.0   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alex 2020-11-30 15:13:34 UTC
When launching the emoji-chooser in plasma 5.19 using the Win-. shortcut, it takes about 2 seconds for the window to open and another second for the categories to load. This is way to long for an efficient emoji picker.

Maybe the window should be preloaded hidden in the background and only shown when the keys are pressed instead of starting to load the emojis only when the window is opened.
Comment 1 Nate Graham 2020-11-30 22:46:09 UTC
Can reproduce the slowness, even on fairly new hardware.
Comment 2 Alex 2020-11-30 23:09:24 UTC
Can I run it from the command line in some way to measure the time from command to seeing the window and maybe running strace or some other helpful tool?

Another issue, which I thought to be unrelated is, that I currently only see black & white emoji. I guess debian testing is not installing the right emoji font, but maybe the emoji-chooser is searching for the fonts for one second?

I guess there are two delays:
- About 1 second to open the window
- About 1 second to load the sidebar (probably enumerating available emojis?)

The first may be an issue from keyboard over hotkeys-handling to running the program and the second one maybe related to font loading?

Just some wild guesses.
Comment 3 David Redondo 2020-12-04 07:43:39 UTC
Git commit d1462745554739ec86fd0e5311d4f271c7a33f3b by David Redondo.
Committed on 04/12/2020 at 07:42.
Pushed by davidre into branch 'master'.

Use Instantiator to create drawer actions to improve startup time

Found with qml profiler that the creation of the drawer actions took the most
time. Using an Instantiator is faster and causes the binding to be evaluated
less often. Before the binding inside Kirigami was evaluated 28 times and it was
the thing the most time was spend on, afterwards creating the window is the most
costly operation.

M  +0    -3    applets/kimpanel/backend/ibus/emojier/emojier.cpp
M  +10   -16   applets/kimpanel/backend/ibus/emojier/ui/emojier.qml

https://invent.kde.org/plasma/plasma-desktop/commit/d1462745554739ec86fd0e5311d4f271c7a33f3b
Comment 4 David Redondo 2020-12-04 07:44:22 UTC
Git commit bbf7543bf5a99887c7f2944134b6bdaa279735a2 by David Redondo.
Committed on 04/12/2020 at 07:44.
Pushed by davidre into branch 'Plasma/5.20'.

Use Instantiator to create drawer actions to improve startup time

Found with qml profiler that the creation of the drawer actions took the most
time. Using an Instantiator is faster and causes the binding to be evaluated
less often. Before the binding inside Kirigami was evaluated 28 times and it was
the thing the most time was spend on, afterwards creating the window is the most
costly operation.


(cherry picked from commit d1462745554739ec86fd0e5311d4f271c7a33f3b)

M  +0    -3    applets/kimpanel/backend/ibus/emojier/emojier.cpp
M  +10   -16   applets/kimpanel/backend/ibus/emojier/ui/emojier.qml

https://invent.kde.org/plasma/plasma-desktop/commit/bbf7543bf5a99887c7f2944134b6bdaa279735a2
Comment 5 nbgyan 2020-12-20 09:19:55 UTC
The application does does not open at all on my Neon 5.20.4. It reports the following error:

Executable: ibus-ui-emojier-plasma PID: 3124 Signal: Segmentation fault (11) 

And some more crash information below:

The packages containing debug information for the following application and libraries are missing:

/usr/bin/ibus-ui-emojier-plasma
/lib/x86_64-linux-gnu/libQt5Gui.so.5
/lib/x86_64-linux-gnu/libQt5Core.so.5
/lib/x86_64-linux-gnu/libQt5QuickTemplates2.so.5
/lib/x86_64-linux-gnu/libQt5Quick.so.5
/lib/x86_64-linux-gnu/libQt5Widgets.so.5
/lib/x86_64-linux-gnu/libQt5Qml.so.5
Comment 6 Nate Graham 2021-03-25 20:21:15 UTC
We did some performance optimization work, and now it opens and is ready in less than half a second for me in Plasma 5.21. Can you test again in that release? Thanks!
Comment 7 nbgyan 2021-03-26 14:02:57 UTC
Hi @Nate, the application opens now without problem. Kudos to the team involved.
Comment 8 Nate Graham 2021-03-26 14:34:10 UTC
Yay!
Comment 9 nbgyan 2021-04-22 08:46:51 UTC
Hi @Nate, I just realised today that some emojis are missing from the list. Their labels show up with a mouse hover but they are not visible.
Comment 10 Nate Graham 2021-04-22 13:35:56 UTC
Can you please open a new bug report for that?