Search Feedback

150
votes

Editor Performance: Improve playmode times

Profiling & Optimization

-

-

Time spent waiting on entering playmode is a waste and can seriously hinder iteration times.

In an empty project it already is ~1.5s for no appearant reason. In larger projects (Ori and the blind Forest) it got upwards of 20 seconds, up to a whole minute in extreme cases.

The profiler can give some very rudimentary understanding of what's happening here. An empty project looks like this:

http://g2f.nl/0ezzrzw

The ReloadAssemblies routine obviously is the main offender. The DockArea.OnGUI seems to come from the inspector re-creating and re-caching some stuff.

Digging in to the ReloadAssemblies:
http://g2f.nl/06s3q2b

Again it seems that a lot of editor systems here are just busy recreating and re-caching editor related data. ModuleManager is an outlier in that.

This get's worse and worse as project scale increases. Here's a sample from a level of Ori and the blind Forest:

http://g2f.nl/042dvka

Note: The numbers don't make a lot of sense anymore. I think the profiler doesn't display stuff over 10.000 ms well? Actual playmode time was about 19 seconds.

The biggest standouts are

-Serialize / Deserialize backups takes up the majority of the time. I can only guess what this does, but I assume that this applies unsaved settings from the editor to the new runtime objects. That feels like a really bad way to go about it - the scene didn't have any changes. Unity already keeps track of changes since last save - could it not just reapply those? This is basically doubling play mode times right now

-RebuildScriptCaches: again more cache rebuilding on every playmode for no reason. In a large project like this it's up to almost a second (!)

-SetLoadedEditorAssemblies seems to have increased with project size too

Other issues like the ModuleManager and such are of course also still there.

All in all, this is wasting a lot of time for every developer. The main takeaway is two things:

1. There needs a way to have some caches survive playmode, and not be recreated everytime.
2. The way playmode state is created should be reconsidered, the current way doesn't scale

I really hope UT can improve this.
Thanks for taking a look!

-Arthur

Comments (8)

  1. 56a8ff197950dd5fdc6c1d1162f13349?d=mm

    junmin4

    Jul 03, 2018 12:17

    I am also waiting for an update on this

  2. 3f5b0bfc7f58cf9ec2cce795a9e8c65a?d=mm

    DeusExMachina1993

    Jun 07, 2018 08:38

    any update on this issue?

  3. E93bcbb039bd1ccd437332e01703116b?d=mm

    chrisbogregson

    Feb 20, 2018 09:10

    We see the exact same thing in our project using 2017.3.1. As your code base increases to the size of a real game project this startup phase takes longer and longer wasting development time for every person on the team.

  4. Eba1a736f8d5fbea223d276b234ca113?d=mm

    RodrigoSpilim

    Nov 08, 2017 16:41

    Any updates on this? Did anyone found a way to improve the performance in some way?
    I've seen the tip of removing files not used in the project, but is there any other thing I can try beyond that?

  5. Dbb974595595996957e0a36f3f58027e?d=mm

    pvloon

    Nov 02, 2017 16:38

    @Vectrex: Little late but just for the record: We have, repeatedly. They said it'd be good to get it on unity feedback too

  6. 4ebd4a00b0e84cc0bf7510fbb8bbb1cc?d=mm

    kookyoo

    Apr 19, 2017 11:26

    A little up here as it is still a noticeable issue that could help save time and improve iteration time in editor.

  7. 607ce6a9c9e2262a248c6fddde99f5ef?d=mm

    Vectrex

    Dec 17, 2015 02:10

    Also, if you worked on Ori I'd email Unity directly (or tweet) because they'd pay attention over this feedback system.

  8. 607ce6a9c9e2262a248c6fddde99f5ef?d=mm

    Vectrex

    Dec 17, 2015 02:06

    Yes, I'm coming across this more and more.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(11030)

2D

(290)

Ads

(63)

AI & Navigation

(83)

Analytics

(130)

Animation

(413)

Asset Store

(370)

Asset Store Publisher

(21)

Assets

(557)

Audio

(185)

Cloud Build

(154)

Collaborate

(70)

Docs & Tutorials

(251)

Editor

(2579)

Everyplay

(17)

Game Performance Reporting

(22)

General

(1003)

Graphics

(903)

GUI

(447)

Input

(173)

Licensing

(93)

Networking

(192)

Physics

(392)

Platforms

(448)

Profiling & Optimization

(84)

Runtime

(188)

Scripting

(1154)

Terrain

(177)

WebGL

(145)