A tech artist came to me and said “whenever we touch anything in a Unity shader graph, the editor stalls. It’s painfully annoying.” And yes, any meaningful change to the graph stalls the editor. Sometimes a bit, sometimes long. So I decided to improve this a bit. Time-boxed to two days (with some interruptions) and see how far I get. The goal is not to do clever optimizations but to stop doing silly things and see where that leads. Here is what I have found.
As an example, take a modestly sized shader. I clicked to insert a “line breaker” into an edge, which doesn’t change the functionality of the graph at all.
This takes anywhere between 1s and 2s per click, depending on how many GC runs we provoke. Note in particular that there is a 200ms call into the shader compiler to preprocess the shader. Foreshadowing!
On bigger graphs, this gets worse. Imagine this every day, constantly, for every click. I’ve found this annoying after just a minute.