From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: speeding up Babel Gnuplot Date: Wed, 04 Jan 2017 23:36:14 +0100 Message-ID: <87d1g2sba9.fsf@nicolasgoaziou.fr> References: <5864217C.7060001@free.fr> <586963CB.1000006@free.fr> <87d1g6qrqh.fsf@nicolasgoaziou.fr> <586AB3DB.6070702@free.fr> <586C1A53.90601@free.fr> <87wpebbygr.fsf@nicolasgoaziou.fr> <586C2E80.4050805@free.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOuAR-00017j-Gu for emacs-orgmode@gnu.org; Wed, 04 Jan 2017 17:36:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOuAQ-0002ZA-Kz for emacs-orgmode@gnu.org; Wed, 04 Jan 2017 17:36:23 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:54087) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cOuAQ-0002XB-Er for emacs-orgmode@gnu.org; Wed, 04 Jan 2017 17:36:22 -0500 In-Reply-To: <586C2E80.4050805@free.fr> (Thierry Banel's message of "Wed, 04 Jan 2017 00:06:40 +0100") 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: Thierry Banel Cc: emacs-orgmode@gnu.org Hello, Thierry Banel writes: >>> (car pair) ;; variable name >>> - (let* ((val (cdr pair)) ;; variable value >>> - (lp (listp val))) >>> - (if lp >>> + (let ((val (cdr pair))) ;; variable value >>> + (if (not (listp val)) >>> + val >>> + (let ((temp-file (org-babel-temp-file "gnuplot-")) >>> + (first (car val))) >>> + (setcdr pair temp-file) ;; <------ caching here [...] > Your proposal provides an additional benefit: caching file generation > between several invocations of Babel. (The cache in my patch is intended > to be used within a single Babel invocation, and is then garbage > collected.). The drawback is that we need to go through all rows of the > table, compute the hash, just to discover that the hash was already > known. The purpose of the cache was precisely to avoid going through the > table again. I'm not sure to understand. I suggest to compute the hash of VAL before it is sent through `org-babel-gnuplot-table-to-data', i.e., before `orgtbl-to-generic' is called. There's no "going through the table" involved, is it? Regards, -- Nicolas Goaziou