From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id U52TGh5ztV67awAA0tVLHw (envelope-from ) for ; Fri, 08 May 2020 14:56:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id sCtGBitztV6qbwAAB5/wlQ (envelope-from ) for ; Fri, 08 May 2020 14:56:43 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D590F94104A for ; Fri, 8 May 2020 14:56:40 +0000 (UTC) Received: from localhost ([::1]:52056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jX4Qb-0001do-Fz for larch@yhetil.org; Fri, 08 May 2020 10:56:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX4QD-0001ah-1X for emacs-orgmode@gnu.org; Fri, 08 May 2020 10:56:17 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:44080) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jX4QB-0005ad-MR for emacs-orgmode@gnu.org; Fri, 08 May 2020 10:56:16 -0400 Received: from [IPv6:2a01:e35:1398:10f0:58bd:508d:d40b:2fb0] (unknown [IPv6:2a01:e35:1398:10f0:58bd:508d:d40b:2fb0]) by smtp1-g21.free.fr (Postfix) with ESMTPS id 7C7C6B0059C for ; Fri, 8 May 2020 16:56:13 +0200 (CEST) Subject: Re: [PATCH] faster org-table-align To: emacs-orgmode@gnu.org References: <00ea3013-c768-cdd9-3385-980bba796460@free.fr> <87v9l65yo3.fsf@nicolasgoaziou.fr> From: tbanelwebmin Message-ID: <2d327155-7d74-cfa1-5081-e85746e129dd@free.fr> Date: Fri, 8 May 2020 16:56:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <87v9l65yo3.fsf@nicolasgoaziou.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: none client-ip=212.27.42.1; envelope-from=tbanelwebmin@free.fr; helo=smtp1-g21.free.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/08 10:56:13 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; GENERIC_REPUTATION(0.00)[-0.49912400798219]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; FREEMAIL_FROM(0.00)[free.fr]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.10), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[tbanelwebmin@free.fr,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[emacs-orgmode@gnu.org]; DMARC_NA(0.00)[free.fr]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_TLS_LAST(0.00)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: Obun0XeIQ6ad Le 08/05/2020 à 15:44, Nicolas Goaziou a écrit : > Hello, > > tbanelwebmin writes: > >> `org-table-align' may benefit from recent `org-table-to-lisp' >> speed-up. >> >> The current code contains the following lines in org-table.el. They >> parse the table into a Lisp structure, which is precisely what >> `org-table-to-lisp' is supposed to do. >> >> (fields (mapcar >> (lambda (l) >> (and (not (string-match-p org-table-hline-regexp l)) >> (org-split-string l "[ \t]*|[ \t]*"))) >> (split-string (buffer-substring beg end) "\n" t))) >> >> Just replace them by a call to `org-table-to-lisp': >> >> (fields (cl-loop for row in (org-table-to-lisp) >> collect (and (listp row) row))) > Good catch! I applied a similar change in master. Let me know how it > goes. > > Thank you! > > Regards, > I ran again my benchmark with your patch. The Emacs profiler is not accurate enough to tell which one among `mapcar' and `cl-loop' is best. Anyway, your patch is perfect! Thanks!