Boost logo

Boost :

Subject: Re: [boost] Interest in Remote Procedure Call Library?
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2010-02-10 18:36:31


I cannot post the code at this time (still pending employer approval in spite of the fact that 100% of the development of this code refractor is unpaid!)

Ok, benchmark running on Mac OS X with g++ -O2

MyClass c;
MyClass* cp = &c;

stub<MyClass> s(cp);

int (MyClass::*a)(int,int) = &MyClass::add;

comparing (cp->*a)(1,2) to s.add(1,2)

On average there is less than .001 us per call difference between the two methods for a trial run of 1024^3 invocations.

Of course the compiler could optimize c.add(1,2) to the point that it was "unmeasurable".

It is as I would have expected, the entire abstraction layer has almost no run time overhead and so the rest of the performance will be in how fast you can serialize your data and send it out the port.

Dan

On Feb 10, 2010, at 5:32 PM, OvermindDL1 wrote:

> On Wed, Feb 10, 2010 at 7:38 AM, Rutger ter Borg <rutger_at_[hidden]> wrote:
>>> // server
>>>
>>> SomeClass myclass;
>>> Server myserver( &myclass, "my.named.service" );
>>>
>>> // client
>>>
>>> RemoteInterface<SomeClass> ri( "my.named.service" );
>>> int result = ri.add(1,4); assert( result == 5 )
>>> ri.sub( 5, 1, &result ); assert( result == 4 );
>>> ri.inout(result); assert( result == 9 );
>>>
>>
>> Hello Dan,
>>
>> I'm interested. Is the assumption of classes and member functions needed?
>> What about mimicking the boost::function interface?
>>
>> asio::io_service ios;
>> client m_client( ios, "rpc://server/" );
>>
>> remote_function< void( int ) > m_func = m_client( "some.resource" );
>
> Yep, that is how mine worked, just based on a Boost.Function interface.
>
>
>
> On Wed, Feb 10, 2010 at 8:57 AM, Daniel Larimer <dlarimer_at_[hidden]> wrote:
>> I need to run some benchmarks, but I believe that the "cost" of using a stub<MyClass,default_delegate> vs a direct pointer to MyClass is at most one function call and a member function pointer de-reference and at best, completely inlined so as to be "identical" at run time.
>>
>> Does anyone have any pointers on how to "compare" the asm generated by a particular line or group of lines of code? I would like to see how much inlining is actually going on and monitor the cause/effects of different template/code structures on the resulting code.
>
> If you come up with some benchmarks I would like to compare it to what
> I made a couple of years ago (where I was admittedly not as
> experienced with such things as I am now), so if you could post the
> complete compilable example with included libraries, I am interested.
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk