https://dev.entrouvert.org/https://dev.entrouvert.org/favicon.ico?15861920342016-01-22T17:14:51ZRedmine Entr’ouvertAuthentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408402016-01-22T17:14:51ZBenjamin Dauvergne
<ul></ul><p>Bad news <a class="external" href="https://github.com/kennethreitz/tablib/issues/19">https://github.com/kennethreitz/tablib/issues/19</a></p>
<p>I think the only way forward would be to rewrite the ODS export using equivalent w.c.s. code. generating XML files directly.</p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408432016-01-22T17:19:42ZBenjamin Dauvergne
<ul></ul><p>Strangely the implementation in tablib at the date of the issue does not use openpyxl for ods export at all...</p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408462016-01-22T17:36:37ZBenjamin Dauvergne
<ul></ul><p>Completely strange behaviour:</p>
<pre>
In [14]: %timeit -n1 -r1 tablib.Dataset(*[(i,i) for i in range(1000)]).ods
1 loops, best of 1: 3.55 s per loop
In [15]: %timeit -n1 -r1 tablib.Dataset(*[(i,) for i in range(1000)]).ods
1 loops, best of 1: 297 ms per loop
</pre>
<p>But the code is just ugly<sup><a href="#fn1">1</a></sup>, it even seems false ( <code>ws.addElement(table.TableColumn()) </code> done on each row of each column ?!?).</p>
<p id="fn1" class="footnote"><sup>1</sup> <a class="external" href="https://github.com/kennethreitz/tablib/blob/develop/tablib/formats/_ods.py#L54">https://github.com/kennethreitz/tablib/blob/develop/tablib/formats/_ods.py#L54</a></p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408472016-01-22T17:48:14ZBenjamin Dauvergne
<ul></ul><p>Big improvement:<br /><pre>
--- /usr/lib/python2.7/dist-packages/tablib/formats/_ods.py 2014-10-13 23:44:09.000000000 +0200
+++ /tmp/_ods.py 2016-01-22 18:47:32.346140742 +0100
@@ -68,33 +68,18 @@
except TypeError:
## col is already unicode
pass
- ws.addElement(table.TableColumn())
# bold headers
if (row_number == 1) and dataset.headers:
odf_row.setAttribute('stylename', bold)
- ws.addElement(odf_row)
cell = table.TableCell()
p = text.P()
p.addElement(text.Span(text=col, stylename=bold))
cell.addElement(p)
odf_row.addElement(cell)
-
# wrap the rest
else:
- try:
- if '\n' in col:
- ws.addElement(odf_row)
- cell = table.TableCell()
- cell.addElement(text.P(text=col))
- odf_row.addElement(cell)
- else:
- ws.addElement(odf_row)
cell = table.TableCell()
cell.addElement(text.P(text=col))
odf_row.addElement(cell)
- except TypeError:
ws.addElement(odf_row)
- cell = table.TableCell()
- cell.addElement(text.P(text=col))
- odf_row.addElement(cell)
</pre></p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408482016-01-22T17:49:05ZBenjamin Dauvergne
<ul></ul><p>It seems that tablib and/or ods export have never been really used...</p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=408522016-01-22T18:30:17ZBenjamin Dauvergne
<ul></ul><p>It still takes more thant 1Go of memory to build the ODS and the gunicorn worker is killed :/</p> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=474342016-05-10T16:39:32ZMikaël Atesmates@entrouvert.com
<ul><li><strong>Version cible</strong> mis à <i>2.2.0</i></li></ul> Authentic 2 - Bug #9747: Improve performance of users export to ODShttps://dev.entrouvert.org/issues/9747?journal_id=1450262018-12-18T08:48:20ZFrédéric Pétersfpeters@entrouvert.com
<ul><li><strong>Statut</strong> changé de <i>Nouveau</i> à <i>Rejeté</i></li></ul><p>L'export ODS a finalement été retiré, <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Development: retirer le lien annonçant une possibilité d'export ods (Fermé)" href="https://dev.entrouvert.org/issues/26450">#26450</a>.</p>