when does a new material instance get created

lets say i have something like this :

function Update(){
	 ch_spriteRenderer.color.a -= fadeAmount;
	 ch_spriteRenderer.color.g -= greenBlueFade;
	 ch_spriteRenderer.color.b -= greenBlueFade;
	 ch_spriteRenderer.color.r -= redFade;
}

Does this mean that
FOR EVERY SINGLE FRAME,
FOR EVERY SINGLE LINE,
A NEW MATERIAL INSTANCE IS GENERATED FOR THE OBJECT CONTAINING THE SCRIPT?

as in 4 new materials instances every frame?

which would of course continously break batching correct?

To answer your specific question, you will only get a new material instance onceā€¦the first time you change any material property. After that, your object will use the same material instance. To demonstrate, run this:

#pragma strict

private var mat : Material;

function Start() {
    mat = renderer.sharedMaterial;
}
  
function Update () {
    if (mat != renderer.sharedMaterial) {
    	Debug.Log("Material different");
    	mat = renderer.sharedMaterial;
    }
	renderer.material.color = Color(Random.value, Random.value, Random.value);
}