Skip to content

perf: use GIO instead of xdg-mime for app.getApplicationNameForProtocol() - #51251

Merged
ckerr merged 1 commit into
mainfrom
perf/faster-app.getApplicationNameForProtocol-on-linux
Apr 23, 2026
Merged

ckerr merged 1 commit into
mainfrom
perf/faster-app.getApplicationNameForProtocol-on-linux

Conversation

@ckerr

@ckerr ckerr commented Apr 22, 2026 •

Copy link
Copy Markdown
Member

Description of Change

Speed up app.getApplicationNameForProtocol() on Linux by using GIO library calls g_app_info_get_default_for_uri_scheme() and g_app_info_get_display_name()) instead of spawning a shell to call xdg-mime.

This cleans up the tests a little too, since we don't have to mock xdg-mime anymore for CI.

Related: #51099, #51197

Checklist

Release Notes

Notes: Improved performance of app.getApplicationNameForProtocol() on Linux.

@ckerr ckerr added platform/linux performance 🏁 semver/none target/42-x-y PR should also be added to the "42-x-y" branch. labels Apr 22, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Apr 22, 2026
…ol()

The Linux impl of app.getApplicationNameForProtocol() now uses
`g_app_info_get_default_for_uri_scheme()` + `g_app_info_get_display_name()`
instead of spawning a call to the `xdg-mime` shell command.

Clean up the related tests: remove the xdg-mime mock.
@ckerr
ckerr force-pushed the perf/faster-app.getApplicationNameForProtocol-on-linux branch from f73141a to 171fe1a Compare April 23, 2026 14:30
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Apr 23, 2026
@ckerr
ckerr merged commit 7d6227a into main Apr 23, 2026
170 of 175 checks passed
@ckerr
ckerr deleted the perf/faster-app.getApplicationNameForProtocol-on-linux branch April 23, 2026 20:09
@release-clerk

release-clerk Bot commented Apr 23, 2026

Copy link
Copy Markdown

Release Notes Persisted

Improved performance of app.getApplicationNameForProtocol() on Linux.

@trop

trop Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "42-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

@ckerr has manually backported this PR to "42-x-y", please check out #51628

dsanders11 pushed a commit that referenced this pull request May 15, 2026
…tocol()` (#51628)

perf: use GIO instead of `xdg-mime` for `app.getApplicationNameForProtocol()` (#51251)

perf: use GIO instead of xdg-mime for app.getApplicationNameForProtocol()

The Linux impl of app.getApplicationNameForProtocol() now uses
`g_app_info_get_default_for_uri_scheme()` + `g_app_info_get_display_name()`
instead of spawning a call to the `xdg-mime` shell command.

Clean up the related tests: remove the xdg-mime mock.
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants