Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] ulimit option completions using ulimit -a output
- X-seq: zsh-workers 48280
- From: Lawrence Velázquez <vq@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] ulimit option completions using ulimit -a output
- Date: Sat, 27 Mar 2021 17:25:16 -0400
- Archived-at: <https://zsh.org/workers/48280>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-03/3ffc50f7-3e0b-43e7-9519-16d473c96c8f%40www.fastmail.com>
- In-reply-to: <12152-1606479571.438744@cBp9.JV-x.oecz>
- List-id: <zsh-workers.zsh.org>
- References: <20201123214942.hi2rx7n3jk25ucmd@chazelas.org> <74327-1606347813.918593@HxCz.NV4p.AwzH> <20201126201431.a6ym56gcagomyvzk@chazelas.org> <20201127071357.kifmnsmf45f6vkw3@chazelas.org> <12152-1606479571.438744@cBp9.JV-x.oecz>
Anything else on this? (Sorry if I end up sending too many messages about these ulimit changes; it's a little difficult to follow the threads.)
vq
On Fri, Nov 27, 2020, at 7:19 AM, Oliver Kiddle wrote:
> Stephane Chazelas wrote:
> > By the way, should I cache that list of options retrieved from
> > the output of "ulimit -a"? After all, it's not going to change
>
> I wouldn't bother. It's a shell builtin, everything it outputs is
> straight from memory so the only cost is a single fork. No delay is
> discernable.
>
> > from one run to the next. But then again, a $(ulimit -a) command
> > substitution is going to be fast and caching uses up memory. Do
> > you have recommendations as to when to cache and when not to?
>
> Mostly it comes down to what seems sensible in a particular case. The
> main criteria being if a delay is noticable. But it would also depend
> whether it is the type of command that is likely used repeatedly in a
> session (which ulimit probably isn't much). There's also the choice
> of just cache in a variable in memory vs. using the cache functions
> to store it in a file. I'm more inclined towards that when it is very
> large.
>
> Oliver
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author