tal: append the length property to the initial allocation.
Since we never post-add a length property, we can save some cycles by
allocating it together with the object itself:
Before:
$ ./samba-allocs talloc.dump --tal
Tal time: 6058997-6215211(6102645)ns
Tal_free time: 4791112-4968964(4824814)ns
Single tal_free time: 3173647-3331584(3200183)ns
$ ./samba-allocs talloc.dump --tal-size
Virtual size = 9809920, RSS = 3952640
After:
$ ./samba-allocs talloc.dump --tal
Tal time: 5911994-6043808(5956914)ns
Tal_free time: 4676026-4834598(4719908)ns
Single tal_free time: 2888195-3067365(2922298)ns
$ ./samba-allocs talloc.dump --tal-size
Virtual size = 9809920, RSS = 3948544
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Showing
Please register or sign in to comment