Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fastest serialize data format form PHP reading

I have a PHP frontend and a C++ backend, and I need to be able to send groups of names to the frontend. What serialized format would be the most efficient/fastest for the PHP to read?

Example data

group1:
  name1 3923
  name2 9879
  name3 8944
group2:
  name5 9823
group3: 
  name9 9822
  name1 4894

What would be the fastest for PHP to read?

  • XML
  • JSON
  • YAML
  • Protocol Buffer
  • Comma/Space Delimited our own system
  • Anything else? other?
like image 672
The Unknown Avatar asked Apr 16 '26 13:04

The Unknown


1 Answers

PHP's own serialized format will probably be the fastest. unserialize() is the function PHP uses to convert this data back to its own types. This post has various links to other languages' implementations of PHP's serialized format, I'm sure you could convert one of those easily.

like image 192
Chad Birch Avatar answered Apr 19 '26 02:04

Chad Birch