def time_openpyxl_optimised():
    start_time = clock()

    workbook = openpyxl.workbook.Workbook(optimized_write=True)
    worksheet = workbook.create_sheet()

    for row in range(row_max // 2):
        string_data = ["Row: %d Col: %d" % (row, col) for col in range(col_max)]
        worksheet.append(string_data)

        num_data = [row + col for col in range(col_max)]
        worksheet.append(num_data)

    workbook.save('openpyxl_opt.xlsx')

    elapsed = clock() - start_time
    print_elapsed_time('openpyxl   (optimised)', elapsed)
Run OpenPyXL in optimised mode.
dataset/ETHPy150Open jmcnamara/XlsxWriter/dev/performance/bench_excel_writers.py/time_openpyxl_optimised