Using C++ for backend processing with C# GUI frontend - is it worth it?

I’m working on an application that needs to handle hundreds or thousands of messages per second and display the processed data as real-time graphs. Users will search for specific datasets and see the results plotted immediately.

I’m confused about how to use DLLs to do the heavy message processing in C++ while passing the results to a C# user interface. Could someone explain this in simple terms?

I’m also worried about performance. Will calling functions between C++ and C# layers be slower than just building everything in one language? I know C++ is faster for processing, but I’ve heard that creating modern, professional-looking GUIs in C++ is difficult. That’s why I’m considering C# with WPF for the interface part.

Any advice would be helpful.

that’s a reely cool setup! I’m curious, how complex are the messages ur processing? using DLLs is clever, but consider the marshaling overhead, especially with so many msgs. what kind of data are u conveying between the C++ and C#?

Built something similar three years back for financial data processing. The DLL route works great, but nail the interface design first. Make a C++ DLL with C-style functions that handles message batches instead of one-by-one processing. Cuts down the marshaling overhead big time. When passing data back to C#, stick to simple structures or arrays - they marshal cleanly. Don’t use complex C++ objects at the boundary, they’re a pain. The interop hit is basically nothing when you batch 100-500 messages at once. For GUI stuff, C# with WPF is way more productive for decent-looking interfaces. You get the best of both worlds, and the tiny interop cost is totally worth the faster development and easier maintenance.

the interop’s actually pretty solid if you design it right. skip the DLL calls and use memory mapped files instead - way faster for high frequency data. have ur C++ process the msgs and dump results to shared memory, then C# reads directly from there. cuts out most marshaling overhead and u still get ur nice WPF interface.