Re: 'cat' and 'rm' as builtins ?

2016-10-30 Thread Chris F.A. Johnson

On Sun, 30 Oct 2016, Tim Rühsen wrote:
...

Since cat and rm implementations are pretty small in code size, I wonder if
you (the maintainers) would accept patches to make these commands builtin
commands.


   Have you looked at the loadable builtins in the examples directory?

--
Chris F.A. Johnson, 

'cat' and 'rm' as builtins ?

2016-10-30 Thread Tim Rühsen
Hi,

currently, some GNU people are developing ideas and code to speed up the GNU 
toolchain (autotools, make).

A simple ./configure for wget calls 'cat' ~2000 times, same with 'rm'.
This sums up to a roughly 5-10% of the overall time used in ./configure.

Since cat and rm implementations are pretty small in code size, I wonder if 
you (the maintainers) would accept patches to make these commands builtin 
commands.

To keep backward compatibility for sure, these builtins could be disabled by 
default. A following small change in autotools could enable these.

My current plan is to use the builtin code for 'cat' only when no options are 
given. If options are given, fall back to fork/exec.

With 'rm' I would use builtin code for no options, for -r and for -f (and -r/-
f combined), else fall back to fork/exec.

WDYT ?

Regards, Tim


signature.asc
Description: This is a digitally signed message part.


Re: 'cat' and 'rm' as builtins ?

2016-10-30 Thread Tim Rühsen
On Sonntag, 30. Oktober 2016 17:33:15 CET Tim Rühsen wrote:
> Hi,
> 
> currently, some GNU people are developing ideas and code to speed up the GNU
> toolchain (autotools, make).
> 
> A simple ./configure for wget calls 'cat' ~2000 times, same with 'rm'.
> This sums up to a roughly 5-10% of the overall time used in ./configure.
> 
> Since cat and rm implementations are pretty small in code size, I wonder if
> you (the maintainers) would accept patches to make these commands builtin
> commands.
> 
> To keep backward compatibility for sure, these builtins could be disabled by
> default. A following small change in autotools could enable these.
> 
> My current plan is to use the builtin code for 'cat' only when no options
> are given. If options are given, fall back to fork/exec.
> 
> With 'rm' I would use builtin code for no options, for -r and for -f (and
> -r/- f combined), else fall back to fork/exec.
> 
> WDYT ?

Sorry, me again =)

Just found examples/loadables...
If ./configure detects bash, it could load custom shared objects of course.
Less invasive, just project-related, but more control outside of bash (e.g. 
one could enable the loadables from config.site file).

Tim


signature.asc
Description: This is a digitally signed message part.