Comments (2)
It shouldn't take anything like a minute to create a 4.5MB file.
Here is a sample program I ran as a test:
#include "xlsxwriter.h"
int main() {
int max_row = 45000;
int max_col = 50;
lxw_workbook *workbook = workbook_new("c_perf_test.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL);
for (int row_num = 0; row_num < max_row; row_num++) {
for (int col_num = 0; col_num < max_col; col_num++) {
if (col_num % 2)
worksheet_write_string(worksheet, row_num, col_num, "Foo", NULL);
else
worksheet_write_number(worksheet, row_num, col_num, 12345.0, NULL);
}
}
workbook_close(workbook);
return 0;
}
I put this in the examples directory of a repo clone and compiled it as follows:
make examples
This runs in around 2.5sec:
$ time ./examples/c_perf_test
real 0m2.424s
user 0m1.945s
sys 0m0.311s
And the output file is ~ 4.5MB:
$ ls -lh c_perf_test.xlsx
-rw-r--r-- 1 John staff 4.6M 23 Dec 10:19 c_perf_test.xlsx
This was on a 3.2 GHz 6-Core Intel Core i7 Mac mini with macOS 14.2.1 (Sonoma).
I'd suggest starting with the same example, verifying the performance, and if it is more or less the same then try to figure out what extra work your program is doing.
from libxlsxwriter.
Thanks for that. I just looked into it a little more and I have to convert values from strings and the checks to determine the value type seem to be slowing things down. Nothing to do with this library.
from libxlsxwriter.
Related Issues (20)
- Linker error when trying to use latest version with macOS project HOT 1
- Linux(CentOS6) Build Error.
- LXW_ERROR_CREATING_XLSX_FILE: error creating output xlsx file. Usually a permissions error. HOT 1
- cannot run on x64 Release in Visual Studio 2022 HOT 5
- Issue: Corrupt file compiled using VS2008 on Windows HOT 9
- Issue when using constant memory with merge range HOT 2
- password HOT 1
- Still Tagging Releases? HOT 2
- 1.1.6 release did not get marked as latest release HOT 4
- How to insert image data of type CV:: Mat HOT 2
- test/functional/test_image.py::TestCompareXLSXFiles::test_image58 failure on 32bit architectures HOT 10
- Bug: workbook_validate_sheet_name buffer-overflow HOT 4
- Bug: workbook_add_worksheet does not return a reasonable worksheet HOT 1
- workbook_define_name stack-buffer-underflow HOT 2
- workbook_close stack-buffer-overflow HOT 4
- _store_array_formula heap-buffer-overflow HOT 5
- worksheet_set_selection stack-buffer-overflow HOT 1
- Question: Are people still using the libxlsxwriter cocoapod?
- Chinese in workbook_add_worksheet cause crash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxlsxwriter.