[Kde-bindings] Using a custom RealProxy to implement a C# SMOKE adaptor

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Aug 22 10:32:26 UTC 2003


On Friday 22 August 2003 03:24, Marcus wrote:
> I believe that C# has superior mechanisms for interoperating with C and C++
> than does Java. RealProxy was designed for remoting, and there is going to
> be a substantial amount of overhead in any kind of remoting activity.

I've done a quick comparison of the overhead of a Proxy invocation vs. JNI in 
Java, and the JNI call is about 10x faster. On an 800 MHz iBook, this loop 
with 10 million method calls took 3.5s in JNI against 35s via proxy calls:

		QFont myFont = new QFont();
		
		for (int count = 0; count < 5000000; count++) {
			myFont.setPointSize(18);
			QFont.removeSubstitution("Times Roman");
		}

So about 3 million method calls/s vs 0.3 million/s. 

-- Richard

> On Thursday 21 August 2003 5:03 am, Richard Dale wrote:
> > I'm interested in whether creating a facade of custom RealProxy's to
> > allow all C# calls to be funneled into a single Invoke() is a good thing.
> > That Invoke() needn't even call the SMOKE library - it could be some
> > other 'black box' created in a different way. Is dynamic method
> > overloading resolution and despatch a problem with respect to efficiency
> > compared with the normal static despatch approach in language bindings.
> > Once, you had built a RealProxy based facade in C#, it could be easily
> > used for all the other .NET languages.


More information about the Kde-bindings mailing list