Selecting in the Editor is _very_ slow when DevTools are open

First let me say that there is a considerable lag when selecting things in the Editor ever if the DevTools aren’t open. It’s noticeable on Chrome and terrible on Firefox.

For some reason though, when DevTools are open (doesn’t matter if it’s in the Editor, the Code Editor or the Launch window) that lag becomes unbearable.

Here’s the chrome profiler screenshot from the starter scene with a single plane and a box consisting of two clicks selecting both objects one after another:

When you say considerable lag, how long is that? Are we talking tens of seconds or a few seconds?

It’s well below a second at about 300-500ms. Can’t actually measure it since with DevTools open it’s about 1.5s.

It was “growing” problem, and now it is worse indeed. It is related to how long it takes to template HTML in inspector. I will be looking into that, to make sure we do something clever there, trying reuse and/or create only necessary DOM elements.

Reason why it takes much longer in Firefox, is that it is much slower in creating elements.

Thank you for reporting on issue.

Why is then that when opening Code Editor through somescript.js->Edit and then opening DevTools inside of the spawned window the lag increases?
Note that there is no additional lag when I copy the URL of the Code Editor (or the Launch), manually open a new browser tab/window with that URL and then open DevTools inside of that.

When you open links from one page to another, even if they are new tab, but same domain, browsers tend to share JS thread between them. This leads to shared JS execution cursor, and as JS being single-threaded in a core, this leads of polluting performance for other tabs that share that thread. There is an opener attribute been added to links, and is supported in Chrome, that can “notify” that new tab should be independent, but this is down to browsers to follow on that rules. I’ve added it in few places, but will check as probably missed in few others.

Interestingly, if you open Launch, and then start profiling your game, in profiling stats you will see Editor’s stuff too. This I think have been improved using this opener attribute. I will consider adding it to all other links too.

Even breakpoints are shared between shared context, so previously in Chrome if you breakpoint in Launcher, it would freeze Editor too. Now it should be all ok due to opener = null trick.

FYI the issue still persists.

  1. Open Editor
  2. Launch
  3. Open DevTools in the Launch window.
  4. Editor is now very slow (unusable)

Assuming almost everyone uses DevTools while writing their games this problem seems important.

Odd, I’m not seeing this problem at all. Chrome 56 Mac, both windows visible with the editor in one and the launch window with devtools in the other. Which browser are you running in? Is this happening on one specific project or all of them?

I’m on Chrome 58, Windows 10. It was the same on the couple of previous Chrome versions.
It happens on all projects.

Does this help:

  • Open your scene in Editor.
  • Hit the launch button.
  • Copy the launch URL
  • Close the launch tab
  • Open a new tab
  • Paste the launch tab

Now, when you open Dev Tools in your launch tab, is the Editor tab still slow?

Hmm… Tried this on Chrome 58 on Mac:

And Chrome 55 on Windows 10

This is with launching from the Play button in the top right.

It doesn’t slow down when opened from the URL. That’s how I’m doing it.

Hi, I am facing this issue since today morning. When I select one entity and then select another, the editor takes a lot of time to update the inspector :frowning: