freebsd-nq/usr.sbin/pkg_install
David E. O'Brien 2bae1ab6a5 Remove s_strl*(). I am not sure what was thought they accomplished.
When reading the code I had to stop, say "ok, what does *these*
modifications of strl*() do?  Pull out grep.  Oh, not in add/, maybe above
in ../lib/?  Yep.  So what do they do?  Comments above them are misleading,
guess I'll have to read the code.  Oh, they just test strl* against the
size and return the result of the test.  Now I can continue to read the
code I was.

The uses of s_strl*() then test that result and errx()'s.
Lets think about the "optimized" code I am removing:

In general the compiler pushes the three args to strl* onto the stack and calls
s_strl*.  s_strl* has to indirectly access 3 args from the stack.  Then push
them on the stack a 2nd time for the real strl* call.  s_strl* then pops the
return from strl* off the stack; or moves it from the register it was returned
in, to the register where tests can happen.  s_strl* then pops the three
arguments to strl*.  Perform the test, push the result of the test, or move it
from the result register to the return value register.  The caller to s_strl*
now has to either pop the return value of s_strl* or move it from the return
value register to the test register.  The caller then pops the three args to
s_strl* off the stack (the same args that s_strl* itself had to pop off after
the real call to strl*).  The s_strl* caller then performs a simular test to
what has already been done, and conditionally jumps.  By doing things this way, we've given the compiler optimizer less to work with.

Also, please don't forget the that call to s_strl* has possibly jumped to code
not in the cache due to being far away from the calling code, thus causing a
pipeline stall.

So where is the "optimization" from s_strl*?
It isn't code clarity.
It isn't code execution speed.  It isn't code size either.
2001-07-28 01:59:58 +00:00
..
add Remove s_strl*(). I am not sure what was thought they accomplished. 2001-07-28 01:59:58 +00:00
create Perform a major cleanup of the usr.sbin Makefiles. 2001-07-20 06:20:32 +00:00
delete Perform a major cleanup of the usr.sbin Makefiles. 2001-07-20 06:20:32 +00:00
info Perform a major cleanup of the usr.sbin Makefiles. 2001-07-20 06:20:32 +00:00
lib Remove s_strl*(). I am not sure what was thought they accomplished. 2001-07-28 01:59:58 +00:00
sign Perform a major cleanup of the usr.sbin Makefiles. 2001-07-20 06:20:32 +00:00
update mdoc(7) police: removed HISTORY info from the .Os call. 2001-07-10 15:12:08 +00:00
version Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Makefile Perform a major cleanup of the usr.sbin Makefiles. 2001-07-20 06:20:32 +00:00
Makefile.inc - Backout botched attempt to introduce MANSECT feature. 2001-03-26 14:42:20 +00:00
README
tkpkg Remove some $Log$ debris 1999-08-29 15:54:49 +00:00

This is the pkg_install suite of tools for doing maintainance of
software "packages".  More documentation is available in the man pages
for each individual command.

This code was written by Jordan Hubbard for FreeBSD, snatched and
mildly reshaped by John Kohl in NetBSD and the changes taken back into
FreeBSD again by Jordan, who then proceeded to add another couple
of dozen features on top.  Whee! :-)