From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: speeding up Babel Gnuplot Date: Thu, 29 Dec 2016 21:34:25 +0100 Message-ID: <58657351.40000@free.fr> References: <5864217C.7060001@free.fr> <8760m2mrh9.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cMhQG-0006Mo-Lq for emacs-orgmode@gnu.org; Thu, 29 Dec 2016 15:35:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cMhQD-0004GV-JS for emacs-orgmode@gnu.org; Thu, 29 Dec 2016 15:35:36 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:14885) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cMhQD-0003Kn-B6 for emacs-orgmode@gnu.org; Thu, 29 Dec 2016 15:35:33 -0500 In-Reply-To: <8760m2mrh9.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org Le 29/12/2016 21:04, Nicolas Goaziou a =E9crit : > I did some optimizations in master branch. I go below 1 sec for the 150= 0 > 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 iss= ue. And of course improving orgtbl-to-generic benefits to many usages, besidesBabel Gnuplot. Thanks for taking care and doing so so quickly. Thierry