efficient rpc io using vstr

Michael B Allen mba2000 at ioplex.com
Tue Jan 20 09:56:10 GMT 2004


Oops. I thought I caught the first message. It's too easy to hit the send
nuemonic!

Martin Pool said:
>> Anyway the point is, if you're going to make a lot of copies of stuff
>> you
>> might as well use a tempory allocator. Suba is ~20% faster than
>> malloc.
>
> Which malloc, measured how?

Glibc 2.2 malloc. Suba is lockless which I suspect is the source of the
speed boost but of course you have to be more careful in a threaded
environment. And it's a pretty small implementation which doesn't hurt.

All of the code I've referenced is in Libmba:

  http://www.ioplex.com/~miallen/libmba/

See "Browse tbe Source" for suba.c. Most of it is ANSI if you do not
define MSGNO. There's also extensive html and man page documentation. It's
MIT Licensed and each module is designed to be extractable without too
much fuss so feel free to use whatever however.

I beleive the %20 was measured using tcase/tests/SubaExercise.c (or maybe
the other suba case) on my P4 1.8GHz T30 laptop. Just change the struct
allocator * parameter in the test case to NULL to indicate that suba
should use stdlib malloc. Then run:

 $ time ./tmba 5300

Then again with a valid struct allocator * and compare times.

Mike



More information about the samba-technical mailing list