From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: PATH duplications
Date: Thu, 13 Feb 2020 18:47:01 +0100 [thread overview]
Message-ID: <20200213174701.puTkJhE5ezxtSOZkdRkoPp9N3zMWjPT-ONoD-6DhHcw@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-18777@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 2883 bytes --]
New comment by loreb on void-packages repository
https://github.com/void-linux/void-packages/issues/18777#issuecomment-585884449
Comment:
TLDR: imho the speedup is not worth the confusion, but worth adding a comment ("not having these in $PATH would confuse most people" or "these are not needed in void") either way just in case.
A script that runs a command many times - successfully:
```
#! /bin/sh
for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
cat /dev/null; cat /dev/null; cat /dev/null; cat /dev/null
done
```
To test non existing commands:
```
#! /bin/sh
foo&&exit 123 # must NOT be in $PATH
for i in 1 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l m n o p q r s t u v w x y z ; do
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo; foo
done
```
On my computer the first is just as fast even if we replace the first few entries of path with something bogus - PATH=/usr/local/nibs:/usr/local/nib/...:/usr/bin
The second script is indeed almost 3x slower when run with the full path instead of PATH=/usr/bin, but we are talking 0.05s vs 0.13s when we call a nonexisting command 3000 times.
All of that on a cheap laptop from 2015 without an SSD btw - does anyone have different numbers?
next prev parent reply other threads:[~2020-02-13 17:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 17:32 [ISSUE] " voidlinux-github
2020-02-13 17:47 ` voidlinux-github [this message]
2020-02-14 1:53 ` voidlinux-github
2020-02-15 17:53 ` beginner3456789
2020-02-25 20:58 ` loreb
2020-02-25 20:59 ` loreb
2020-02-25 22:48 ` beginner3456789
2020-02-26 23:16 ` [ISSUE] [CLOSED] " beginner3456789
2020-02-27 2:50 ` eli-schwartz
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200213174701.puTkJhE5ezxtSOZkdRkoPp9N3zMWjPT-ONoD-6DhHcw@z \
--to=voidlinux-github@inbox.vuxu.org \
--cc=ml@inbox.vuxu.org \
/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 NNTP newsgroup(s).