0
Fixed

Editor lag with creator mode 'Always' when orbitting in scene view.

RyanL 2 months ago updated by Lazlo Bonin (Lead Developer) 2 months ago 4

Just installed Peek (1.2.0f1) and very much enjoying the functionality on offer. 

However, it quickly became apparent that the editor was lagging at times while using this plugin. Narrowing it down, when the creator mode is set to 'Always' (or 'FullScreen Only' when in fullscreen) in the preferences, the editor lags considerably while using right click dragging to orbit the scene view. When the creator is disabled, the performance issue disappears. 

I set up at test project using Unity 2020.1.6f1 and spawned in a grid of 65,000 cubes, leaving Peek settings as default when imported. I attached the deep profiler and it appears Probe.PickAllNonAlloc() is spamming HandleUtility.PickGameObject() while orbitting with the right mouse button. See the attached image for an example.

I'm new to Peek, so I'm unsure whether it is an unreasonable expectation to have the creator running with large scenes or if this is indeed a valid issue. Either way, thanks!

Unity Version:
2020.1.6f1
Peek Version:
1.2.0f1

I was just going to create a topic for this as well! It's indeed caused by the Peek.Creator and a quick way to solve it is by checking if any shortcuts are used before doing any object picking.

Without posting the whole file, I changed line 35-41 from this:

var position = sceneView.GetInnerGuiPosition(); 

Handles.BeginGUI();

var shortcut = PeekPlugin.Configuration.creatorShortcut;

if (position.Contains(e.mousePosition))

To this:

var position = sceneView.GetInnerGuiPosition(); 
var shortcut = PeekPlugin.Configuration.creatorShortcut;

if (!shortcut.Preview(e) && !shortcut.Check(e))
{
return;
}

Handles.BeginGUI();

if (position.Contains(e.mousePosition))

In Assets/Ludiq/Ludiq.Peek/Editor/Creator/Creator.cs

That solves the stutters completely and you can still use the Creator when holding Shift+Ctrl

Works like a charm! Thanks for the reply.

+1
Working on Fix

D'oh! I missed that performance cost when restructuring the code for the new configurable shortcuts in v.1.2.0.

Thanks for doing my work for me Roy ;) I'll implement this or something similar and issue a hotfix patch (v.1.2.0f2) ASAP.

Fixed

This is now fixed in v.1.2.0f2.