On Tue, May 6, 2014 at 10:32 AM, Max Belkin
<
bernardito.l...@gmail.com> wrote:
> For the last few days I was comparing the speed of creating an xls/xlsx file
> with different modules. xlwt is the best. It is 2 times faster than openpyxl
> and xlsxwriter (both are mutually equal).
In my experience, XlsxWriter is not that much slower than xlwt. But
of course performance can depend on a lot of factors.
> My question is in the subject - can the higher performance be reached?
> May be there is some kind of optimization of memory usage as in other
> modules and I haven't noticed it?
XlsxWriter and OpenPyXL both have optimized modes:
http://xlsxwriter.readthedocs.org/working_with_memory.html
http://pythonhosted.org/openpyxl/optimized.html#optimized-writer
There is also a newer package called PyExcelerate (NOT to be confused
with the old, buggy, no-longer-maintained pyExcelerator!), if you
don't need all the features of XlsxWriter:
https://github.com/whitehat2k9/PyExcelerate
You could also try using PyPy (in place of regular Python).
Beyond these measures, there's really not much to be done. If you
need significantly more speed, you probably have to look at using
faster (compiled) languages. (If you wind up writing C accelerator
modules for any of these Python packages, be sure to publish them! ;)
John Y.