Alloying two materials can do two things: Either a new material is created by interpolating from the parent materials, or if the two parent materials match one of a small list of recipes you get a predetermined output.
Apparently the way they do the latter is to first go through and interpolate a new material, a fairly costly operation, to then check that interpolated material's parent materials for matches. If one is found, the interpolated material is discarded.