• Stars
    star
    856
  • Rank 53,268 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unity Tool showing a timeline of assembly compilation. This is especially helpful when trying to optimize compile times and dependencies between assemblies. Besides showing a graphical view of compilation, selecting an assembly shows both dependencies and dependents of that assembly.

Compilation Visualizer for Unity

Unity Version Compatibility openupm

What's this?

This tool visualizes the assembly compilation process in Unity3D. It hooks into the Editor-provided events and nicely draws them on a timeline. That's especially helpful when trying to optimize compile times and dependencies between assemblies.

Besides showing a graphical view of compilation, selecting an assembly shows both dependencies and dependents of that assembly.

The screenshots show full compilations; but the timeline works as well for partial compilations (e.g. you changed a single script and Unity only recompiles the relevant parts of the dependency chain).

Quick Start

Compilation Visualizer is available on OpenUPM: https://openupm.com/packages/com.needle.compilation-visualizer/

If you're on Unity 2019.4+:

  • open Edit/Project Settings/Package Manager
  • add a new Scoped Registry or add the package to the existing OpenUPM scope:
    Name: OpenUPM
    URL:  https://package.openupm.com/
    Scope(s): com.needle.compilation-visualizer
    
  • click Save
  • open Package Manager
  • click +
  • select Add from Git URL
  • paste com.needle.compilation-visualizer
  • click Add.

You can open the Compilation Visualizer by selecting Window > Analysis > Compilation Timeline. It will automatically update whenever something is compiled.

Compilation Process

Recompile

If you want to trigger a recompile, you can either use the Recompile button, or Right Click > Reimport a script or folder with scripts to cause that to be recompiled.

You can also compile player scripts only, by clicking Compile Player Scripts. Use the dropdown button to switch to another platform.

On 2021.2+, Unity changed how compilation results are cached. The Recompile and Compile Player Scripts will clear those caches to allow measuring a full compilation run.

Navigation

Left Click to select a specific assembly. This will show dependencies and dependants.
Hover over an assembly to get additional details.
Alt + Scroll Wheel to zoom in/out.
Alt + Right Click to reset zoom.

Compact will toggle between a waterfall view of all assemblies, and a compact collapsed view that tries to save space.
Logging turns on a lot of extra logs that will be put into the Console when clicking on an assembly.
Show Reloads adds an extra section in the timeline to see how much time went into compilation and how much into the following Domain Reload.

EditMode tests

Compilation Visualizer can run edit mode tests to ensure your project compiles on all platforms, catching common mistakes with ifdefs and API compatibility.
To use these tests, simply add it to the "testables" section in your project manifest.json:

  "testables": [
    "com.needle.compilation-visualizer"
  ],

Then, when you open Window > General > Test Runner you can click Run All or double-click CompilePlayerScripts.

EditMode Tests

Screenshots

Compilation Process Coloring Options Compact View Compact View with selected assembly Expanded View Expanded view with selected assembly

Compatibility to 2018.4, 2019.1, 2019.2

While most functionality works great those versions, some minor things are different:

  • slightly less accurate total compilation time on 2018.4 — 2019.1+ has events for the entire compilation while on 2018.4 the last finished assembly compilation is used as end date.
  • no PackageInfo for now on 2018.4/2019.1 as PackageInfo.FindForAsset doesn't exist.

Known Issues

On 2021.2, sometimes UnityEditor.UI.dll and UnityEditor.TestRunner.dll are included in Player Builds for reasons.

Contact

needle — tools for unity • @NeedleTools • @marcel_wiessler • @hybridherbst

More Repositories

1

needle-engine-support

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and includes networking and XR - across platforms. Documentation at https://docs.needle.tools
JavaScript
543
star
2

custom-timeline-editor

custom keyframes for Unity's timeline 🎞 (interpolate lists of anything) with visual tools 🖌 and C# to computeshader binding
C#
240
star
3

shadergraph-markdown

Markdown-like syntax for ShaderGraph properties, to make better material inspectors
C#
237
star
4

missing-component-info

Serializes and renders âš  missing component info in Unity
C#
137
star
5

selective-profiling

Selectively deep profile single methods in Unity's Profiler 🔬
C#
133
star
6

ar-simulation

AR Simulation for Unity • Right in the Editor • Minimally Invasive
109
star
7

hybrid-packages

Export UPM packages as .unitypackage files
C#
106
star
8

needle-console

âš¡ Improved Unity Console adding better log and stacktrace readability, log filtering, log hyperlinks and more
C#
80
star
9

needle-engine-samples

Live: https://engine.needle.tools/samples 🌵 Needle Engine sample scenes - use as examples and as a reference for learning 😊
TypeScript
74
star
10

animation-utils

This package contains some utilities that help working with Unity's Timeline and Animation tools, for example drag & drop to fix âš  missing clip bindings
C#
71
star
11

console-hyperlinks

Adds hyperlink handling for Unity console logs and more
C#
68
star
12

usd-viewer

USD Web Viewer based on Autodesk's WASM USD bindings and a three.js Hydra render delegate
JavaScript
67
star
13

shader-variant-explorer

Shader Variant Explorer lets you peek into Unity's shader compilation process to better understand the composition of shader files.
C#
60
star
14

timeline-mixer

allows for overriding timeline animations per animator
C#
38
star
15

procedural-stochastic-texturing

C#
28
star
16

unity-deeplink

C#
27
star
17

remote-hierarchy

View Hierarchy and Inspector of scenes on connected Unity players. Uses the EditorConnection framework, so works everywhere.
C#
19
star
18

unity-editor-modes

Change Unity Editor modes 🖥
C#
17
star
19

glitch-package-installer

Service helping to create installers for Unity packages
JavaScript
15
star
20

transform-changed-helper

Handles transform.hasChanged for you
C#
15
star
21

CopyPaster

Copy paste gameobjects across Unity projects
C#
12
star
22

dxc-compiler-experiments

C#
9
star
23

needle-engine-modules

TypeScript
9
star
24

editorpatching

C#
8
star
25

needle-context-menu

Override Unity project menu items (experimental, dont use in production)
C#
8
star
26

unity-analyzers-starter

Custom Analyzers Sample / Starter
C#
6
star
27

unity-type-merger

Merge multiple classes into one using SourceGenerators
C#
5
star
28

lipsync

unity lipsync integration using rhubarb and timeline
C#
4
star
29

unity-prewarm-packman

Tiny helper package to speedup PackageManager startup time
C#
3
star
30

Unity-Custom-Undo

Handle custom commands in unity undo stack
C#
3
star
31

asset-explorer

Asset explorer built with Needle Engine and SvelteKit
TypeScript
3
star
32

custom-timeline-playground

C#
3
star
33

weaving

Persistent modifying using Fody (use at own risk)
C#
2
star
34

droplets

drop things on bats like there's no tomorrow
Batchfile
1
star
35

git-hooks

Auto install hooks when opening a repo
Shell
1
star
36

gpu-animation-testassets

C#
1
star
37

needle-tools.github.io

Public Website
HTML
1
star
38

gpu-animation

skinned animation on the gpu
C#
1
star
39

IL-explorer

Utility window to view Intermediate Language (IL) for any type in Unity Project 🔬
C#
1
star