1

From my main c# app, I start many slave process with Process.Start method. (on the same PC)

Just before starting those slave process, I serialize some data (I have serialized class) in XML files which are passed in the arguments of Process class.

In each slave process, those data are deserialized and a computation is done. A new serialization is done to XML in order to send result to the main process.

My apps works but the performance are very bad. The time of serialization/deserialization operation is too long because the size of each XML file is about 1,5 Mo...

I really need a high-performance for this simple communication between main app and slave process.

How can I easily modify my code to improve this performance ? Nb : in the future my main process will be in 64 bits and the slaves process in 32 bits.

I have heard that some apps allows to virtualize hard disk in RAM ? Does it exist ? Is it free ?

I have heard of WCF, Named Pipe, Memory Mapped, etc but I seems to be heavy to use ....?

Patrice Pezillier
  • 4,476
  • 9
  • 40
  • 50
  • http://stackoverflow.com/questions/2635272/fastest-low-latency-method-for-inter-process-communication-between-java-and-c try n check out...will be helpfull to you. Thanks>! – Pranav Bilurkar May 23 '14 at 10:01
  • Could you show us some code? – scheien May 23 '14 at 10:03
  • So do you want the fastest *or* the easiest way? – sloth May 23 '14 at 10:10
  • if performance is key why are you doing this using many processes? given the processes are running on the same machine why not use a single process with multiple threads instead? – wal May 23 '14 at 14:06

2 Answers2

2

Memory-mapped files (MMF) are the fastest method. The problem though, as you point, is in serialization rather than transfer itself. Serialization is necessary for any transport, even MMFs (except the simplest cases when you have simple data records which can be laid out sequentially in memory). XML is not fast - binary serialization of any kind would work much better.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121
0

Use SlimSerializer from here: https://github.com/aumcode/nfx/tree/master/Source/NFX/Serialization/Slim

hundreds of thousands of serialization transactions on a second on a single thread - that is for "typical Person" object (name, address , contact info, salary)

Also see this post about Glue

Glue is designed for "glue-ing" processes together very efficiently

Video

Another Video (In Russian)

itadapter DKh
  • 596
  • 3
  • 7