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

Useless call of xdg-mime that is not working properly and slow down startup #4350

Closed
avi9526 opened this issue Nov 23, 2024 · 1 comment · Fixed by #4379
Closed

Useless call of xdg-mime that is not working properly and slow down startup #4350

avi9526 opened this issue Nov 23, 2024 · 1 comment · Fixed by #4379
Assignees
Labels
bug Something isn't working OS: Linux performance Related to (improving) performance

Comments

@avi9526
Copy link

avi9526 commented Nov 23, 2024

  • Operating System (Linux/Mac/Windows/iOS/Android): Linux
  • Delta Chat Version: deltachat-desktop 1.46.8-1
  • Expected behavior: Fast startup
  • Actual behavior: Slow startup with freezing desktop (Plasma) for 1..2 seconds
  • Steps to reproduce the problem: Install Arch Linux, update it, install Plasma desktop, install DeltaChat, launch it and login, close, launch it as:

strace -c electron30 /usr/lib/deltachat-desktop/app.asar

close DeltaChat from tray icon after main window appears

strace report include:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ------------------
 90.08    0.388022       29847        13         1 wait4
  2.64    0.011358           7      1577           ppoll
  …

became root and do:

cd /bin/
mv xdg-mime /root/
cp -r echo xdg-mime

repeat strace run from above, output is:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ------------------
 38.23    0.021738        1672        13         1 wait4
 16.67    0.009478           5      1591           ppoll
 …

Changes in launch time is visually noticeable - it opens almost instantly

  • Screenshots:
    null
  • Logs:
    strace logs include
04:19:54 wait4(33498, xdg-mime: application argument missing
Try 'xdg-mime --help' for more information.
[{WIFEXITED(s) && WEXITSTATUS(s) == 4}], 0, NULL) = 33498 <0.273471>

It seems xdg-mime is not doing anything useful and quits with an error.

Fast workaround is:
/usr/bin/bash -c 'function xdg-mime { echo ; }; export -f xdg-mime; /usr/bin/deltachat-desktop --minimized'

@Simon-Laux Simon-Laux self-assigned this Dec 2, 2024
@Simon-Laux
Copy link
Member

I think on linux it is only ever useful in appImage because in other cases uri scheme association is already done via desktop file. But even there we could live without it, also not setting file/uri association could be seen as feature for people using app images as portable apps. So I think just disabling the code on linux is fine.

Simon-Laux added a commit that referenced this issue Dec 2, 2024
by disabling the functions to register DC as protocol handler - on linux this is anyway done by the desktop file

fixes #4350
@Simon-Laux Simon-Laux added bug Something isn't working performance Related to (improving) performance labels Dec 2, 2024
@nicodh nicodh closed this as completed in ddc8a78 Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OS: Linux performance Related to (improving) performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants