I noticed that I've a HUGE bottleneck in this following function of mine. I can't see how to make it faster.
These are the profiling test results(keep in mind that I'm using a PyQt GUI so times can be stretched):
def write_workbook_to_file(self, dstfilename):
self.populaterownumstodelete()
# actual column in the new file
col_write = 0
# actual row in the new file
row_write = 0
for row in (rows for rows in range(self.sheet.nrows) if rows not in self.row_nums_to_delete):
for col in (cols for cols in range(self.sheet.ncols) if cols not in self.col_indexes_to_delete):
self.wb_sheet.write(row_write, col_write, self.parseandgetcellvalue(row, col))
col_write += 1
row_write += 1
col_write = 0
I ran a cProfile
profiling test and write_workbook_to_file()
resulted the slowest function in all my application. parseandgetcellvalue()
isn't a problem at all.