From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: quickly find all executables
Date: Mon, 28 Jul 2003 11:20:55 -0600 [thread overview]
Message-ID: <3F255B77.70100@yahoo.com> (raw)
In-Reply-To: 7ik7a6edaq.fsf@neoscale.com
Kin Cho wrote:
> Eric Marsden <emarsden@laas.fr> writes:
>
>> (remove-if-not 'file-executable-p
>> (mapcan (lambda (dir) (directory-files dir t))
>> (remove-if-not 'file-directory-p exec-path)))
>>
>
> Thanks. This code is significantly shorter than Kevin Rodgers'
> version, and it runs in virtually the same amount of time for my
> setup (ok, about .02 seconds slower to be exact).
Did you add in the time needed to load cl (a prerequisite for cl-seq
and cl-extra), cl-seq (for remove-if-not), and cl-extra (for mapcan)?
:-)
> This is quite amazing to me -- I thought lambda's are function
> calls, and function calls are slow, at least on a CISC CPU like
> the P4 that I'm running on.
Lisp function calls are relatively slow, but you can't determine
how many functions are called just by looking at the code.
Also, did you try byte-compiling the code? Eric's code would probably
benefit the most, because of the lambda form.
--
Kevin Rodgers
next parent reply other threads:[~2003-07-28 17:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7iznj4wrb1.fsf@neoscale.com>
[not found] ` <wzihe5bvtll.fsf@melbourne.laas.fr>
[not found] ` <7ik7a6edaq.fsf@neoscale.com>
2003-07-28 17:20 ` Kevin Rodgers [this message]
2003-07-28 19:23 ` quickly find all executables Kin Cho
2003-07-28 20:16 ` Stefan Monnier
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F255B77.70100@yahoo.com \
--to=ihs_4664@yahoo.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).