Khandrikov & Reznikov: The Effective Structured Data Marshalling/Demarshalling Through Boost.Fusion
Channel: CppNow
Date: 2016-07-14

The Effective Structured Data Marshalling/Demarshalling Through Boost.Fusion Introspection In A High Performance Web Service The Yandex company is the one of the biggest internet companies in Russia. We provide various users' network interactive services, such as: web-search, e-mail, maps, photohosting and so on. Our team is developing e-mail backend. Message receiving, handling, sending are most typical tasks in backend service. At C++Now 2014 we talked about the optimization of a Boost.Asio-based networking server. Now we want to talk about effective data marshalling and demarshalling which is taking a significant part of our internal web services workload. In this talk we are looking for generic solution of effective marshalling and demarshalling of a structured data like instances of structures, STL containers, classes and so on. We start from the simple implementation which is based on the Boost.Fusion framework, discuss the problems and limitations of this solution. Then we propose different workarounds and optimisations of the solution to achive the performance. We propose solutions based on following key points: * minimization of data copying in order to decrease CPU and memory usage; * elimination of hidden synchronization and locks to provide maximum parallelism and independed work of the solution in different threads; * asynchronous interfaces to use callbacks and/or coroutines for the IO events handling; * stream-like raw data and structured objects processing. For each of these points we provide overview on how it affects total performance.
---

*--*

---