[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] make function local
From: |
Greg Wooledge |
Subject: |
Re: [Help-bash] make function local |
Date: |
Mon, 20 Apr 2015 16:14:39 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Mon, Apr 20, 2015 at 03:04:00PM -0500, Peng Yu wrote:
> Hi Chet,
> > I disagree that performance overhead in typical use is `significant'.
> > This point is more or less identical to the one I discussed Friday in
> > regards to creating huge numbers of variables. Who creates 100,000
> > shell functions in a single script? The overhead, such as it is, of
> > creating and calling even 10,000 functions is negligible.
>
> Why do you assume that one only calls each of these functions once?
> What if a function is called thousands of time?
The point is, the performance is *perfectly acceptable* if your script
only defines 10,000 functions instead of 100,000 functions. You are
arguing to make a performance tuning adjustment for a situation that
will never arise in real life.
> The performance difference is 10x different (0.490s vs 0.040s). To me,
> this is a huge performance problem.
It would be a "huge performance problem" (maybe) if your script actually
declared 100,000 functions.
Do you have any scripts that declare 100,000 functions?
> The main point that Linda and I are making is that we suggest add the
> local function feature. I believe that we've made the case --- it
> makes the code cleaner and run faster.
What makes you think adding function namespaces (or whatever means of
localization) would make things run FASTER instead of slower?
- Re: [Help-bash] make function local, (continued)
- Re: [Help-bash] make function local, Linda Walsh, 2015/04/17
- Re: [Help-bash] make function local, Greg Wooledge, 2015/04/17
- Re: [Help-bash] make function local, Linda Walsh, 2015/04/17
- Re: [Help-bash] make function local, Eduardo A . Bustamante López, 2015/04/17
- Re: [Help-bash] make function local, Linda Walsh, 2015/04/17
- Re: [Help-bash] make function local, Eduardo A . Bustamante López, 2015/04/17
- Re: [Help-bash] make function local, Chet Ramey, 2015/04/19
- Re: [Help-bash] make function local, Peng Yu, 2015/04/19
- Re: [Help-bash] make function local, Chet Ramey, 2015/04/20
- Re: [Help-bash] make function local, Peng Yu, 2015/04/20
- Re: [Help-bash] make function local,
Greg Wooledge <=
- Re: [Help-bash] make function local, Chet Ramey, 2015/04/20