Re: .NET Remoting/Serialization way too slow vs C++ binary/tcp

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Pete Davis (pdavis68_at_NOSPAM.hotmail.com)
Date: 03/15/05


Date: Tue, 15 Mar 2005 09:46:54 -0600


> If .NET Remoting / Serialization is so slow, why would anyone ever use
> it over C++ for performance critical applications that transmit
> hundreds of thousands of messages per day ? Is the tradeoff really
> worth it ? What are people's thoughts ?
>

If you're only doing hundreds of thousands per day, then the fact that it
takes 5 minutes to handle 100,000 iterations means that you could handle
nearly 29 million iterations every 24 hours.

But why not just do the same thing in C# that you're doing in C++ if
performance is critical? That's the tradeoff. If you want performance, open
a socket, pack the data in a byte array and send it out. The serialization
stuff in .NET is necessarily slow because it requires reflection. I can't
really speak for the remoting stuff as I haven't had a need to use it. If
performance is an issue, serialization isn't your friend.

Pete