johnste / finicky

A macOS app for customizing which browser to start
MIT License
3.67k stars 136 forks source link

[performance] Noticeable delay when opening links #222

Open anatolebeuzon opened 2 years ago

anatolebeuzon commented 2 years ago

Thanks for this very helpful app.

After clicking on a link, there is a noticeable delay before the matching browser gets opened. I've noticed it consistently regardless of the underlying browser (Safari, Firefox and Chrome). I'd guesstimate somewhere around 300 ms.

That delay is even higher when using Google Chrome profile matching, also a guesstimate but I'd say 800 ms. Any suggestion on how to find out where the time is spent / what is blocking? Does Finicky launch a JavaScript runtime every time a link is clicked?

Your configuration macOS 11.6.1, finicky 3.4.0

johnste commented 2 years ago

There's a small delay before Finicky opens a window because of a Finicky detects if a link should be opened in the background or not. It's unfortunate but I don't have a better solution for now. https://github.com/johnste/finicky/blob/b495669d6ebceff8d4bec0662fc120cda90b475f/Finicky/Finicky/AppDescriptor.swift#L49

mitchsw commented 2 years ago

It sounds like if I set openInBackground: false this 120ms delay is avoided? I guess I may see issues from menu bar apps (https://github.com/johnste/finicky/issues/126), but that doesn't seem important to me right now.