Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

History suggestions can take a few seconds to be found #25875

Closed
julienw opened this issue Jul 4, 2022 · 22 comments
Closed

History suggestions can take a few seconds to be found #25875

julienw opened this issue Jul 4, 2022 · 22 comments
Assignees
Labels
performance Possible performance wins
Milestone

Comments

@julienw
Copy link

julienw commented Jul 4, 2022

Steps to reproduce

I'm not so sure if this is 100% reproducible, but at least on my profile, it can take seconds to return results that I know they are here.
My STR is typing a few characters in the address bar and then waiting too much time.

Expected behavior

The suggestions should appear very quickly.
BTW this bug is about the history suggestions. The search suggestions are very fast.

Actual behavior

I took a profile of the main JVM thread when this happened. Especially notice the more than 5 seconds for the last suggestion update.
https://share.firefox.dev/3nD6Rk5
Please tell me if I should capture again with different settings.

Device information

  • Android device: Samsung S10e, with Android v12
  • Fenix version: 104 Nightly, build #2015889675 (July 1st). But this happens for me for what seems like forever.

┆Issue is synchronized with this Jira Task

@julienw julienw added the performance Possible performance wins label Jul 4, 2022
@github-actions github-actions bot added the needs:triage Issue needs triage label Jul 4, 2022
@julienw julienw changed the title Suggestions can take a few seconds to be found History suggestions can take a few seconds to be found Jul 4, 2022
@julienw
Copy link
Author

julienw commented Jul 4, 2022

Here is another profile, very similar: https://share.firefox.dev/3IbcAag

@Earlopain
Copy link

Earlopain commented Jul 5, 2022

Related to #23717?

@julienw
Copy link
Author

julienw commented Jul 5, 2022

very likely to be related indeed

@mcomella
Copy link
Contributor

mcomella commented Jul 6, 2022

@julienw Can you take a new profile with the io JVM threads included?

Triage: this looks like same bug as #23717 but we'll leave this open to verify they're the same. The profile in this bug mentions the combined history provider and the previous bug is just the history provider – the combined provider is the new version.

@julienw
Copy link
Author

julienw commented Jul 7, 2022

Here is another profile with "io" added to the threads filter: https://share.firefox.dev/3InGS9X
I had to increase the interval to 5ms so that I don't lose data, I hope that will be still good enough.

During this profile I did 3 searches:

  1. I searched for the same one as for the first profile above, but this time it was fast
  2. I searched for a domain that I visited recently, then added a space and searched for some internal page. More concretely, I searched setli to find setlist.fm, then I complete it, press space, and type green to find a green day page inside this website that I visited recently.

Hope this helps!

@julienw
Copy link
Author

julienw commented Jul 7, 2022

I must add some more information: I'm synced with firefox accounts, as well as my firefox desktop browser. And I do have an awful lot of tabs on my desktop browser (I believe more than 1000, maybe 2000). So this may also be the cause.

@Mugurell
Copy link
Contributor

Mugurell commented Jul 7, 2022

Going with the profile from #25875 (comment) and overlapping the suggestion fetcher threads with the "Suggestion update" markers it seems the app is waiting for places to respond to queryAutocomplete() or queryHistoryMetadata(). (all of the more blueish segments are AS-places calls)

image

@Mugurell
Copy link
Contributor

@julienw A somewhat speculative fix should be available in the today's Nightly.
Can you check if you see any improvements or is the issue still reproducing?

@julienw
Copy link
Author

julienw commented Jul 13, 2022

I still see the same problems with my current nightly, but let's wait tomorrow, just in case my nightly doesn't have the fix yet.

@Mugurell
Copy link
Contributor

Mugurell commented Jul 13, 2022

@julienw Just to double check, you are updating via the PlayStore?
Can you please post the version number shown in Settings -> About / a screenshot of that?
We have another patch ready that we can try tomorrow if the profiles still show long running queries. (thank you for the profiles!)

@Earlopain
Copy link

For what its worth, this does seem to fix the other issue at least. I installed the latest nightly and the search result appear almost instantly now. I haven't used nightly before though, so this is a completely new, synced profile. Maybe @DavidJCobb would also want to give the nightly a try?

@julienw
Copy link
Author

julienw commented Jul 13, 2022

@julienw Just to double check, you are updating via the PlayStore?

Yes exactly!

Can you please post the version number shown in Settings -> About / a screenshot of that?
Sure, here it is

Screenshot_20220713-182120_Firefox Nightly

We have another patch ready that we can try tomorrow if the profiles still show long running queries. (thank you for the profiles!)

Do you want new profiles ?

@csadilek
Copy link
Contributor

@julienw Thanks, your build is not up-to-date and doesn't have the first fix @Mugurell landed.

You should see

104.0a1 (Build #2015891883), 2474b15ff+
AC: 104.0.20220712190117, e148a04365
GV: 104.0a1-20220712093327
AS: 93.5.0

In particular the commit hash for as should be e148a04365 and not 4696f894dc. Sometimes it helps force closing the play store app, re-opening and updating Nightly manually.

I don't think we need new profiles. Let's test with the first fix, and we have a second one lined up too.

@julienw
Copy link
Author

julienw commented Jul 13, 2022

I know force installed that one from the playstore, and I still see problems. But I see something weird. When I start Firefox, and search right away, then it's quite responsive. But after a few searches this starts to be slow again (with the same searches). I don't know if this was happening before...

It seems to happen after I do some specific search.
What I do regularly is this:

  1. search for a website (eg in my case: setli => completes to setlist.fm)
  2. I click on the right, press space, then search for something I know is in my history, in my case for example "gre" (to find setlists from Green Day that I looked some days ago)

=> this is quite slow

And then the same queries that used to be fast seems to be now slower.
Although I think they can be slow right away too, but maybe not right at the start of the browser. Is it possible that at the start we run sync, and before that finished the synchronized tabs are not used for search yet?

Also when I type something that doesn't match anything, it's quite long to remove the previous matches.

@Mugurell
Copy link
Contributor

@julienw A new patch was merged to try and fix this issue.
With you being able to easily reproduce the issue can you try again in the latest Nightly?

The versions for today`s Nightly are:

104.0a1 (Build #2015893035), 96472c9d7+
AC: 104.0.20220718174753, 8c96b863dc
GV: 104.0a1-20220718132938
AS: 93.6.0

@julienw
Copy link
Author

julienw commented Jul 20, 2022

My impression is that it's much better. I've still seen some longer-than-expected responses with 1 to 1.5 seconds, but definitely better than the previous situation. I'll still monitor in the coming days.

I've also seen that the result layout has changed, and it looks a bit "broken" in my opinion, but I suspect you know that already.

@Mugurell
Copy link
Contributor

Mugurell commented Jul 20, 2022

@julienw Thank you for testing!

Don't expect any layout change and haven't seen recent reports about this.
Maybe you're seeing a small flicker when suggestions change? This should be fixed in the meantime.
Can you please post a video showcasing the issue?

Also if there are still problems with slow suggestions, can you please go to Settings -> Search and uncheck everything other than "Search browsing history" and then try to get a profile similar to above containing the io threads?

Another good test would be to enable all providers but the one for "Search synced tabs" since you mentioned having more than 1000 open tabs on desktop so this may definitely be a bottleneck.

@julienw
Copy link
Author

julienw commented Jul 21, 2022

@julienw Thank you for testing!

Don't expect any layout change and haven't seen recent reports about this. Maybe you're seeing a small flicker when suggestions change? This should be fixed in the meantime. Can you please post a video showcasing the issue?

I'm not sure how to do a video on my phone...

What seems to happen is that the result panel is scrolled down instead of scrolled up. Previously the search suggestions where at the top with the history suggestions at the bottom, with the panel scrolled to the top, but now the search suggestions at the bottom with the history suggestions at the top but it's scrolled to the bottom... I think ideally I'd like to see the history suggestions, but currently they're paged out of the view because of the scroll (and they were before too).

Also if there are still problems with slow suggestions, can you please go to Settings -> Search and uncheck everything other than "Search browsing history" and then try to get a profile similar to above containing the io threads?

Another good test would be to enable all providers but the one for "Search synced tabs" since you mentioned having more than 1000 open tabs on desktop so this may definitely be a bottleneck.

Good suggestions, I'll do that if I see the problem again.

@Mugurell
Copy link
Contributor

What seems to happen is that the result panel is scrolled down instead of scrolled up. Previously the search suggestions where at the top with the history suggestions at the bottom, with the panel scrolled to the top, but now the search suggestions at the bottom with the history suggestions at the top but it's scrolled to the bottom... I think ideally I'd like to see the history suggestions, but currently they're paged out of the view because of the scroll (and they were before too).

Thank you. I think this is indeed work in progress. @sarah541 to confirm.

@Mugurell
Copy link
Contributor

@Earlopain / @DavidJCobb does the issue with slow history suggestions seem fixed for you in the latest Nightly?

@Earlopain
Copy link

Still works blazingly fast for me now. All is good in the latest nightly.

@Mugurell
Copy link
Contributor

If the problem seems resolved I'll close the issue as Done.
Feel free to leave a comment if the problem persists for you.
Thank you for all the support!

@kbrosnan kbrosnan added this to the 105 milestone Jul 27, 2022
@gabrielluong gabrielluong removed the needs:triage Issue needs triage label Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
performance Possible performance wins
Projects
None yet
Development

No branches or pull requests

7 participants