ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] version script for libdb4.3
Date: Sat, 8 Oct 2005 01:41:12 +0400
Message-ID: <20051007214112.GA27634@nomad.office.altlinux.org> (raw)
In-Reply-To: <20050904214819.GB21568@basalt.office.altlinux.org>


[-- Attachment #1.1: Type: text/plain, Size: 1808 bytes --]

On Mon, Sep 05, 2005 at 01:48:19AM +0400, Dmitry V. Levin wrote:
[...]
> убирание ненужных символов даёт стабилизацию использования и рост скорости
> запуска.  На том же libdb4.3 выигрыш умопомрачительный.

Немного цифр:

$ ls -log {old,new}/libdb-4.3.so 
-rw-r--r--  1 854016 Окт  8 00:17 new/libdb-4.3.so
-rw-r--r--  1 936160 Июн 15 22:31 old/libdb-4.3.so

$ nm -D old/libdb-4.3.so |grep -c '^[0-9a-f]'
1431
$ nm -D new/libdb-4.3.so |grep -c '^[0-9a-f]'
51

$ rm -f my_db.db && env -i LD_DEBUG=statistics LD_LIBRARY_PATH=old ./db_create
     12345:	                 number of relocations: 632
     12345:	      number of relocations from cache: 6
     12345:	        number of relative relocations: 1593
     12345:	
     12345:	runtime linker statistics:
     12345:	           final number of relocations: 748
     12345:	final number of relocations from cache: 6
$ rm -f my_db.db && env -i LD_DEBUG=statistics LD_LIBRARY_PATH=new ./db_create
     12345:	                 number of relocations: 106
     12345:	      number of relocations from cache: 5
     12345:	        number of relative relocations: 2120
     12345:	
     12345:	runtime linker statistics:
     12345:	           final number of relocations: 139
     12345:	final number of relocations from cache: 5

$ env -i LD_LIBRARY_PATH=old time sh -c 'rm -f my_db.db; for i in `seq 10000`; do ./db_create; done'
5.53user 4.15system 0:09.68elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1920466major+361627minor)pagefaults 0swaps
$ env -i LD_LIBRARY_PATH=new time sh -c 'rm -f my_db.db; for i in `seq 10000`; do ./db_create; done'
2.82user 3.91system 0:06.72elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1750466major+351627minor)pagefaults 0swaps


-- 
ldv

[-- Attachment #1.2: db_create.c --]
[-- Type: text/plain, Size: 1183 bytes --]

/* Taken from /usr/share/doc/db-4.3.28/gsg/C/DB.html */

#include <db.h>

int
main(void)
{
	DB     *dbp;		/* DB structure handle */
	u_int32_t flags;	/* database open flags */
	int     ret;		/* function return value */

	/* Initialize the structure. This                                                                            
	 * database is not opened in an environment,                                                                 
	 * so the environment pointer is NULL. */
	ret = db_create(&dbp, NULL, 0);
	if (ret != 0)
	{
		/* Error handling goes here */
		return 1;
	}

	/* Database open flags */
	flags = DB_CREATE;	/* If the database does not exist,                                                     
				 * create it.*/

	/* open the database */
	ret = dbp->open(dbp,	/* DB structure pointer */
			NULL,	/* Transaction pointer */
			"my_db.db",	/* On-disk file that holds the database. */
			NULL,	/* Optional logical database name */
			DB_BTREE,	/* Database access method */
			flags,	/* Open flags */
			0);	/* File mode (using defaults) */
	if (ret != 0)
	{
		/* Error handling goes here */
		return 1;
	}
	return 0;
}

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-10-07 21:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-04 21:06 [devel] version script for libgtk+2 Alexey Tourbin
2005-09-04 21:30 ` Mikhail Zabaluev
2005-09-04 21:48   ` Dmitry V. Levin
2005-10-07 21:41     ` Dmitry V. Levin [this message]
2005-09-04 22:27   ` [devel] " Alexey Tourbin
2005-09-04 21:38 ` [devel] " Dmitry V. Levin
2005-09-04 22:02   ` [devel] " Alexey Tourbin
2005-09-04 22:46   ` [devel] " Mikhail Zabaluev
2005-09-09  4:24 ` [devel] " Alexey Tourbin
2005-09-09  8:33   ` Alexey Tourbin
2005-09-09  8:55     ` Epiphanov Sergei
2005-09-09  8:53       ` Sergey Pinaev
2005-09-09  9:13         ` [devel] Re: version script for libgtk+2 [JT] Vitaly Lipatov
2005-09-09 17:37     ` [devel] Re: version script for libgtk+2 Alexey Rusakov
2005-09-11  9:07     ` Alexey Tourbin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051007214112.GA27634@nomad.office.altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git