106/107 differences (was "Re: MAX_RESOURCES under 1.0.7")

David T-G davidtg-gnupg@justpickone.org
Thu May 9 17:12:02 2002


--y0ulUmNC+osPPQO6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

David, et al --

=2E..and then David Shaw said...
%=20
% On Thu, May 09, 2002 at 09:04:26AM -0500, David T-G wrote:
% >=20
% > Since around version 1.0.2 I have tweaked MAX_RESOURCES with a simple
% > patch
=2E..
% >   +#define MAX_RESOURCES 100
=2E..
% > keyrings.  When building 1.0.7, I found that not only is ringedit.c gone
% > but MAX_RESOURCES is nowhere to be found in the sources.  "Great!", I
=2E..
% > Unfortunately, trying to sign an email message gives me
% >=20
% >   gpg: keyblock resource `/home/davidtg/.gnupg/pubring.corporate+group.=
gpg': resource limit
%=20
% [..]
%=20
% I believe (though have not tested) what you are looking for is
% MAX_KEYDB_RESOURCES, set in keydb.c.

Indeed it is, or at least it works for me.  With the stock version (set
to 20), I cannot decrypt a message encrypted with a key in one of the
last rings in my list, but when I tack on a zero (set to 200) all is
well.

Interestingly enough, I found very, very minimal differences in the
memory footprint of the two versions:

  [zero] [9:57am] ~>  /tmp/gpg-107-small --list-keys > /dev/null & ; sleep =
1 ; ps aguxw | egrep ID\|gpg-107 ; sleep 10 ; ps aguxw | egrep ID\|gpg-107
  [1] 18936
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  18936 58.5  0.1  1880  928 pts/17   R    09:58   0:01 /tmp/gpg-1=
07-small --list-keys
  davidtg  18939  0.0  0.0  1140  472 pts/17   S    09:58   0:00 egrep ID|g=
pg-107
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  18936 92.1  0.1  1924  980 pts/17   R    09:58   0:11 /tmp/gpg-1=
07-small --list-keys
  davidtg  18942  0.0  0.0  1140  472 pts/17   S    09:58   0:00 egrep ID|g=
pg-107
  [zero] [9:58am] ~>
  [1]    Done                          /tmp/gpg-107-small --list-keys > /de=
v/null
  [zero] [9:58am] ~>  /tmp/gpg-107-big --list-keys > /dev/null & ; sleep 1 =
; ps aguxw | egrep ID\|gpg-107 ; sleep 10 ; ps aguxw | egrep ID\|gpg-107
  [1] 18944
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  18944 54.0  0.1  1848  896 pts/17   R    09:58   0:01 /tmp/gpg-1=
07-big --list-keys
  davidtg  18955  0.0  0.0  1140  472 pts/17   S    09:58   0:00 egrep ID|g=
pg-107
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  18944 93.4  0.1  1940  988 pts/17   R    09:58   0:11 /tmp/gpg-1=
07-big --list-keys
  davidtg  18958  0.0  0.0  1140  472 pts/17   S    09:58   0:00 egrep ID|g=
pg-107
  [zero] [9:58am] ~>
  [1]    Done                          /tmp/gpg-107-big --list-keys > /dev/=
null
  [zero] [9:58am] ~>

In fact, both are smaller at the outset than the with a tweaked version
of 106:

  [zero] [10:05am] ~>  /usr/local/bin/gpg-1.0.6 --list-keys > /dev/null & ;=
 sleep 1 ; ps aguxw | egrep ID\|gpg ; sleep 4 ; ps aguxw | egrep ID\|gpg
  [1] 19650
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  19650 99.9  0.1  1904  904 pts/17   R    10:06   0:01 /usr/local=
/bin/gpg-1.0.6 --list-keys
  davidtg  19653  0.0  0.0  1140  472 pts/17   S    10:06   0:00 egrep ID|g=
pg
  USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
  davidtg  19650 99.9  0.1  1916  920 pts/17   R    10:06   0:05 /usr/local=
/bin/gpg-1.0.6 --list-keys
  davidtg  19656  0.0  0.0  1140  472 pts/17   S    10:06   0:00 egrep ID|g=
pg
  [zero] [10:06am] ~>
  [1]    Done                          /usr/local/bin/gpg-1.0.6 --list-keys=
 > /dev/null

The other interesting thing is that it takes 107 much longer to process
my keyrings than 106 did:

  [zero] [9:59am] ~>  time /tmp/gpg-107-big --list-keys > /dev/null
  13.820u 0.040s 0:14.27 97.1%    0+0k 0+0io 198pf+0w
  [zero] [DING!] ~>  time /tmp/gpg-107-small --list-keys > /dev/null
  13.760u 0.070s 0:13.98 98.9%    0+0k 0+0io 198pf+0w
  [zero] [10:00am] ~>  time /usr/local/bin/gpg-1.0.6 --list-keys > /dev/null
  5.800u 0.040s 0:06.10 95.7%     0+0k 0+0io 204pf+0w

I've run each version repeatedly to eliminate any disk-read time, and the
results are always within hundredths of a second of each other.  Is this
large difference expected?


%=20
% David
%=20
% --=20
%    David Shaw  |  dshaw@jabberwocky.com  |  WWW http://www.jabberwocky.co=
m/
% +------------------------------------------------------------------------=
---+
%    "There are two major products that come out of Berkeley: LSD and UNIX.
%       We don't believe this to be a coincidence." - Jeremy S. Anderson
%=20
% _______________________________________________
% Gnupg-users mailing list
% Gnupg-users@gnupg.org
% http://lists.gnupg.org/mailman/listinfo/gnupg-users


Thanks again & HAND

:-D
--=20
David T-G                      * It's easier to fight for one's principles
(play) davidtg@justpickone.org * than to live up to them. -- fortune cookie
(work) davidtgwork@justpickone.org
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!


--y0ulUmNC+osPPQO6
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE82pHoGb7uCXufRwARAkfyAKCejjsP6VcZPRUw8o+biQeLA30PngCgh2WQ
E2hoY5pZ/cZ2Why25Vohh3c=
=ASck
-----END PGP SIGNATURE-----

--y0ulUmNC+osPPQO6--