Slow problem when saving xlsx files in openpyxl

Asked 2 years ago, Updated 2 years ago, 19 views

It's a rudimentary question.

We are creating a program that receives data from the server from time to time and changes the value of the corresponding cell in that row if there is any change.

I used the openpyxl module...

It's data that changes from time to time, so it's stored from time to timeOnly

If the name of the workbook variable is wb,

In wb.save('aaa.xlsx'), it takes as long as 10 seconds at the fastest, or more than 10 seconds at the slowest.

You have to receive data from time to time, but there is a delay of more than 10 seconds over there, so data for more than 10 seconds may be missing.

Is it because the storage device is SSD?

Or will it be faster if I use .xls?

I tried to use csv, but it was complicated to deal with the values that change in the middle, so I try not to use csv as much as possible.

Is there a way to save it quickly?

python

2022-09-22 17:56

1 Answers

It can hardly be because of the SSD... The reason for the slow processing speed is probably because the data is handled in XLSX format.

I would seriously consider using RDBMS. Even if you have to "handle values that change in the middle" and insert them from time to time, that might be a "quicker way." It's actually not a big deal to drop the DB data into an Excel file later.


2022-09-22 17:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.