[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] speeding up Babel Gnuplot
From: |
Thierry Banel |
Subject: |
Re: [O] speeding up Babel Gnuplot |
Date: |
Thu, 29 Dec 2016 21:34:25 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
Le 29/12/2016 21:04, Nicolas Goaziou a écrit :
> I did some optimizations in master branch. I go below 1 sec for the 1500
> rows table.
Confirmed! Your latest commit givesa huge boost.
>> Here is a fix to speed up the rendering to a mere fraction of a second.
>>
>> #+BEGIN_SRC elisp
>> (defun org-babel-gnuplot-table-to-data (table data-file params)
>> "Export TABLE to DATA-FILE in a format readable by gnuplot."
>> (let ((org-babel-gnuplot-timestamp-fmt
>> (or (plist-get params :timefmt) "%Y-%m-%d-%H:%M:%S")))
>> (with-temp-file data-file
>> (mapc (lambda (line)
>> (mapc (lambda (cell)
>> (insert (org-babel-gnuplot-quote-tsv-field cell))
>> (insert "\t"))
>> line)
>> (insert "\n"))
>> table)))
>> data-file)
>> #+END_SRC
> The comparison is not fair, because the function doesn't handle all the
> cases `orgtbl-to-generic' handles.
>
Of course it was not fair.
It was just a quick-and-dirty-not-to-be-commited patch to discuss the issue.
And of course improving orgtbl-to-generic benefits to many usages,
besidesBabel Gnuplot.
Thanks for taking care and doing so so quickly.
Thierry