emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tbanelwebmin <tbanelwebmin@free.fr>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] faster org-table-align
Date: Fri, 8 May 2020 16:56:12 +0200	[thread overview]
Message-ID: <2d327155-7d74-cfa1-5081-e85746e129dd@free.fr> (raw)
In-Reply-To: <87v9l65yo3.fsf@nicolasgoaziou.fr>

Le 08/05/2020 à 15:44, Nicolas Goaziou a écrit :

> Hello,
>
> tbanelwebmin <tbanelwebmin@free.fr> 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!



      reply	other threads:[~2020-05-08 14:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08 12:50 tbanelwebmin
2020-05-08 13:44 ` Nicolas Goaziou
2020-05-08 14:56   ` tbanelwebmin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d327155-7d74-cfa1-5081-e85746e129dd@free.fr \
    --to=tbanelwebmin@free.fr \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] faster org-table-align' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).