relay: Chrome freezes after query returns a "large" response

I’m using fetchQuery() useQueryLoader() and have run into a case where on Chrome (surprisingly Firefox seems fine?) will completely hang and freeze the browser for like 10 seconds after the following request comes back.

Query: https://pastebin.com/tB4M15zA Sample variables: https://pastebin.com/SJt0Mhb1 Sample response: https://pastebin.com/zd04mzTH

This is the flamegraph I got from Firefox’s debugger: image

Here’s the file for the Firefox profile: Firefox 2024-03-14 13.18 profile.json

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I may have to get back to you after the weekend, but will try logging response there and see what happens!

Update! Looks like the culprit is not the original query… I removed another query (fedWorkflowRunsAggregate) and now everything is working fine. Here the details on that query…

Query: https://pastebin.com/tB4M15zA Sample variables: https://pastebin.com/SJt0Mhb1 Sample response: https://pastebin.com/zd04mzTH

The response is actually not any larger than the other queries we’re making… but the variables are definitely huge. I wonder if this has anything to do with it? And maybe that could explain why Firefox performs better than Chrome, if there’s some difference in hashing?

Anyways, I’ll update the title and previous comments to reflect the new info.

  1. Is this what you’re referring to? https://pastebin.com/np5p0fcR (the relevant query here is fedSequencingReads fedWorkflowRunsAggregate)
  2. Sure, here’s the query: ~~https://pastebin.com/Mu7PkD2m~~ https://pastebin.com/tB4M15zA and here’s the variables: ~~https://pastebin.com/X81AkZz1~~ https://pastebin.com/SJt0Mhb1
  3. CPU seems to go to 100% for about 1.5 secs in Firefox (I uploaded the dump in my original comment). Interestingly in Chrome it seems to go to 100% forever until I stop recording the profile! Here’s a link to the Chrome dump: https://drive.google.com/file/d/1LgfvwAbHhpHHELN1lc-454pFFTlAgVsw/view?usp=drive_link
  4. Don’t think so

Map ƒ Map() { [native code] }

npm list react-relay --depth=0 idseq-web@ /Users/bchu/czid-web-private └── react-relay@16.0.0