import cProfile def profile_defcon(): from defcon import Font pr = cProfile.Profile() pr.enable() font = Font("Roboto-Regular.ufo") for glyph in font: for contour in glyph: for point in contour: point.x = 0 point.y = 0 font.save("result1.ufo") pr.disable() pr.print_stats(sort='time') def profile_fontTools(): from fontTools.ufoLib import Font pr = cProfile.Profile() pr.enable() font = Font("Roboto-Regular.ufo") for glyph in font: for contour in glyph.contours: for point in contour: point.x = 0 point.y = 0 font.save("result2.ufo") pr.disable() pr.print_stats(sort='time') if __name__ == "__main__": profile_defcon() profile_fontTools()