tal: add benchmark based on Samba4's talloc usage.
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 18 Nov 2012 03:45:53 +0000 (14:15 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Sun, 18 Nov 2012 04:29:13 +0000 (14:59 +1030)
commit5e0d0dcb720ebbc4998871c63dfd47c00bca11ba
tree03a4e6fa920579400e20beab67d582f46f065dde
parentde8e8cf2e214b880e14b20817e665477a5dc5bdb
tal: add benchmark based on Samba4's talloc usage.

This is based on a very simple dump of S4's talloc tree, which we try
to duplicate using tal.  The benchmarks are simply to allocate all the
nodes, free all the nodes individually, and a top-level free.

Size results (32-bit x86):
$ ./samba-allocs talloc.dump --talloc-size
Read 25998 nodes
Virtual size = 10469376, RSS = 4759552
$ ./samba-allocs talloc.dump --tal-size
Read 25998 nodes
Virtual size = 9629696, RSS = 3948544

Speed results:
$ ./samba-allocs talloc.dump
Read 25998 nodes
Malloc time:             1912082ns
Free time:               1384892ns
Talloc time:             2851531ns
talloc_free time:        2133801ns
Single talloc_free time: 1696298ns
Tal time:                2686952ns
Tal_free time:           3316153ns
Single tal_free time:    1639407ns

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/tal/benchmark/Makefile
ccan/tal/benchmark/samba-allocs.c [new file with mode: 0644]
ccan/tal/benchmark/talloc.dump [new file with mode: 0644]