One or more simulated diffraction signals for use in determining the profile of a structure formed on a semiconductor wafer can be generated, where the profile varies in more than one dimension. Intermediate calculations are generated for variations in a hypothetical profile of the structure in a first dimension and a second dimension, where each intermediate calculation corresponds to a portion of the hypothetical profile of the structure. The generated intermediate calculations are then stored and used in generating one or more simulated diffraction signals for one or more hypothetical profiles of the structure.