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

Main Thread hangs w/ glitch+debugger open in background #7780

Closed
digitarald opened this issue Jan 22, 2019 · 10 comments
Closed

Main Thread hangs w/ glitch+debugger open in background #7780

digitarald opened this issue Jan 22, 2019 · 10 comments
Labels
🐛 bug: P1 👷‍♀️ performance 👋 quality Currently a UI quality priority for the debugger

Comments

@digitarald
Copy link
Contributor

STR:

  • Start a new html-webpage based glitch project
  • Open the Show Live page in a new tab and open the Debugger on it
  • Switch back to tab with Glitch editor
  • Open the script.js file
  • Type away and edit the file (adding a console.log, etc)

ER: Blissful editing with usual performance behaviour
AR: Glitch updating the JS file in the background causes 1s+ hangs (on a high end MBP) from getSourcesByUrlInSources

image

https://perfht.ml/2R6Cn7i

@jasonLaster
Copy link
Contributor

It looks like there are two big issues:

  • checkPendingBreakpoints which uses an expensive check -- perf
  • newSources which calls updateSource -- perf

@darkwing darkwing mentioned this issue Jan 24, 2019
25 tasks
@jasonLaster
Copy link
Contributor

@digitarald i could not reproduce with this example https://glitch.com/edit/#!/workable-worm

Also the profile has a lot of checkPendingBreakpoints did you have any breakpoints set?

@digitarald
Copy link
Contributor Author

Just tried again in Nightly: http://bit.ly/2Wiw58G

I am using https://glitch.com/edit/#!/seed-swamp?path=script.js:8:27 with some async functions and console.trace statements.

@jasonLaster jasonLaster changed the title Severe main thread hangs w/ glitch+debugger open in background Main Thread hangs w/ glitch+debugger open in background Jan 25, 2019
@jasonLaster
Copy link
Contributor

jasonLaster commented Jan 25, 2019

@digitarald the perf link isn't opening for me...
screen shot 2019-01-25 at 6 22 17 pm

@digitarald
Copy link
Contributor Author

@digitarald the perf link isn't opening for me...

Try a hard refresh, this fixed it for me.

@julienw
Copy link
Contributor

julienw commented Jan 29, 2019

Hard refresh should never be necessary, especially now that we have this nifty reload notification. Moreover we (should) reload automatically if we see this error and there's an update.

Basically a hard refresh avoids the service worker, so it may seem to work when the service worker hasn't downloaded an update yet, but this is never a good fix for perf-html :)

I believe this happened because @digitarald doesn't use perf-html.io to capture, but maybe another URL (like master.perf-html.io?)

@julienw
Copy link
Contributor

julienw commented Jan 29, 2019

Or the update wasn't finished yet :)

@digitarald
Copy link
Contributor Author

Updated link that works for me: http://bit.ly/2Wiw58G

@jasonLaster
Copy link
Contributor

jasonLaster commented Jan 29, 2019

thanks. I'm still not reproducing the slowdown, which makes sense given i don't see checkPendingBreakpoints in my profile either. http://bit.ly/2TlZHjs

mind checking how many bps you have saved?

  1. browser toolbox
  2. select debugger.html
  3. await dbg.asyncStore.pendingBreakpoints in the console

@darkwing darkwing added the 👋 quality Currently a UI quality priority for the debugger label Feb 28, 2019
@digitarald
Copy link
Contributor Author

Closing for now as we don't have a working STR; will re-open if I see this again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug: P1 👷‍♀️ performance 👋 quality Currently a UI quality priority for the debugger
Projects
None yet
Development

No branches or pull requests

4 participants