Saturday, July 28, 2012

My experience on C++ Serialization Solutions

Recently I tried 3 solutions for serializing request data in my Apache filter module in C++:
1- Google Protocol Buffer
2- boost serialization
3- msgpack
I was disappointed of using solutions 1 and 2 because of errors I faced. I submitted errors in many forums and related mailing lists, but I couldn't get any answer.
Google protocol buffer seems professional but It needs classes to be defined in specific way which that protocol forces.
BTW I started with this solution and designed *.protoc files and generated my model files.
the solutions worked fine in a console application but I've got segmentation fault in Apache module without any specific error. ( I tried debugging with gdb, ddd,.... but no chance to resolve the error).
So I switched to boost serialization. It was much simpler than Google solution but It didn't work completely.
It worked fine in console application and Apache filter too.
but I've segfault when I tried to serialize nested classes.
I returned to my mind, searching a solution recommended by one of my friends( Kamyar, which has been used that solution in .NET).
It was msgpack, the 3rd solution.
It's much simple than Google solution and even simpler than boost serialization.
It worked fine without any headache. As msgpack website says, It's much fast from Google and boost solution :
http://www.msgpack.org

3 comments :

  1. http://stackoverflow.com/questions/11643402/segfault-happens-when-i-serialize-nested-class-in-apache-module

    ReplyDelete
  2. http://boost.2283326.n4.nabble.com/segfault-happens-when-I-serialize-nested-class-in-apache-module-td4633545.html

    ReplyDelete
  3. https://groups.google.com/forum/?fromgroups#!topic/protobuf/48P9Ak1QVBQ

    ReplyDelete

Saturday, July 28, 2012

My experience on C++ Serialization Solutions

Recently I tried 3 solutions for serializing request data in my Apache filter module in C++:
1- Google Protocol Buffer
2- boost serialization
3- msgpack
I was disappointed of using solutions 1 and 2 because of errors I faced. I submitted errors in many forums and related mailing lists, but I couldn't get any answer.
Google protocol buffer seems professional but It needs classes to be defined in specific way which that protocol forces.
BTW I started with this solution and designed *.protoc files and generated my model files.
the solutions worked fine in a console application but I've got segmentation fault in Apache module without any specific error. ( I tried debugging with gdb, ddd,.... but no chance to resolve the error).
So I switched to boost serialization. It was much simpler than Google solution but It didn't work completely.
It worked fine in console application and Apache filter too.
but I've segfault when I tried to serialize nested classes.
I returned to my mind, searching a solution recommended by one of my friends( Kamyar, which has been used that solution in .NET).
It was msgpack, the 3rd solution.
It's much simple than Google solution and even simpler than boost serialization.
It worked fine without any headache. As msgpack website says, It's much fast from Google and boost solution :
http://www.msgpack.org

3 comments :

  1. http://stackoverflow.com/questions/11643402/segfault-happens-when-i-serialize-nested-class-in-apache-module

    ReplyDelete
  2. http://boost.2283326.n4.nabble.com/segfault-happens-when-I-serialize-nested-class-in-apache-module-td4633545.html

    ReplyDelete
  3. https://groups.google.com/forum/?fromgroups#!topic/protobuf/48P9Ak1QVBQ

    ReplyDelete