From: Wouter van Oortmerssen Date: Fri, 18 Jul 2014 23:15:10 +0000 (-0700) Subject: Updated benchmark chart with stats for pugixml. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d03ba640be0262642847f8a29ac54539dc6a8c12;p=platform%2Fupstream%2Fflatbuffers.git Updated benchmark chart with stats for pugixml. Change-Id: I23d7db5b62ca52fee49e1bedcf7d7d8d74957cf8 Tested: on Windows. --- diff --git a/docs/html/md__benchmarks.html b/docs/html/md__benchmarks.html index 3a8a601..e17ec08 100644 --- a/docs/html/md__benchmarks.html +++ b/docs/html/md__benchmarks.html @@ -53,37 +53,36 @@ $(document).ready(function(){initNavTree('md__benchmarks.html','');});
Benchmarks
-

Comparing against other serialization solutions, running on Windows 7 64bit. We use the LITE runtime for Protocol Buffers (less code / lower overhead), and Rapid JSON, one of the fastest C++ JSON parsers around.

+

Comparing against other serialization solutions, running on Windows 7 64bit. We use the LITE runtime for Protocol Buffers (less code / lower overhead), Rapid JSON (one of the fastest C++ JSON parsers around), and pugixml, also one of the fastest XML parsers.

We compare against Flatbuffers with the binary wire format (as intended), and also with JSON as the wire format with the optional JSON parser (which, using a schema, parses JSON into a binary buffer that can then be accessed as before).

The benchmark object is a set of about 10 objects containing an array, 4 strings, and a large variety of int/float scalar values of all sizes, meant to be representative of game data, e.g. a scene format.

- + - + - + - + - + - + - + - + - + - +
FlatBuffers (binary) Protocol Buffers LITE Rapid JSON FlatBuffers (JSON)
FlatBuffers (binary) Protocol Buffers LITE Rapid JSON FlatBuffers (JSON) pugixml
Decode + Traverse + Dealloc (1 million times, seconds) 0.08 302 583 105
Decode + Traverse + Dealloc (1 million times, seconds) 0.08 302 583 105 196
Decode / Traverse / Dealloc (breakdown) 0 / 0.08 / 0 220 / 0.15 / 81 294 / 0.9 / 287 70 / 0.08 / 35
Decode / Traverse / Dealloc (breakdown) 0 / 0.08 / 0 220 / 0.15 / 81 294 / 0.9 / 287 70 / 0.08 / 35 41 / 3.9 / 150
Encode (1 million times, seconds) 3.2 185 650 169
Encode (1 million times, seconds) 3.2 185 650 169 273
Wire format size (normal / zlib, bytes) 344 / 220 228 / 174 1475 / 322 1029 / 298
Wire format size (normal / zlib, bytes) 344 / 220 228 / 174 1475 / 322 1029 / 298 1137 / 341
Memory needed to store decoded wire (bytes / blocks) 0 / 0 760 / 20 65689 / 40 328 / 1
Memory needed to store decoded wire (bytes / blocks) 0 / 0 760 / 20 65689 / 4 328 / 1 34194 / 3
Transient memory allocated during decode (KB) 0 1 131 4
Transient memory allocated during decode (KB) 0 1 131 4 34
Generated source code size (KB) 4 61 0 4
Generated source code size (KB) 4 61 0 4 0
Field access in handwritten traversal code accessors accessors manual error checking accessors
Field access in handwritten traversal code typed accessors typed accessors manual error checking typed accessors manual error checking
Library source code (KB) 15 some subset of 3800 87 43
Library source code (KB) 15 some subset of 3800 87 43 327

Some other serialization systems we compared against but did not benchmark (yet), in rough order of applicability:

  • Cap'n'Proto promises to reduce Protocol Buffers much like FlatBuffers does, though with a more complicated binary encoding and less flexibility (no optional fields to allow deprecating fields or serializing with missing fields for which defaults exist). It currently also isn't fully cross-platform portable (lack of VS support).
  • msgpack: has very minimal forwards/backwards compatability support when used with the typed C++ interface. Also lacks VS2010 support.
  • Thrift: very similar to Protocol Buffers, but appears to be less efficient, and have more dependencies.
  • -
  • XML: typically even slower than JSON, but has the advantage that it can be parsed with a schema to reduce error-checking boilerplate code.
  • YAML: a superset of JSON and otherwise very similar. Used by e.g. Unity.
  • C# comes with built-in serialization functionality, as used by Unity also. Being tied to the language, and having no automatic versioning support limits its applicability.
  • Project Anarchy (the free mobile engine by Havok) comes with a serialization system, that however does no automatic versioning (have to code around new fields manually), is very much tied to the rest of the engine, and works without a schema to generate code (tied to your C++ class definition).
  • diff --git a/docs/source/Benchmarks.md b/docs/source/Benchmarks.md index 85305cb..6792bbb 100755 --- a/docs/source/Benchmarks.md +++ b/docs/source/Benchmarks.md @@ -2,7 +2,8 @@ Comparing against other serialization solutions, running on Windows 7 64bit. We use the LITE runtime for Protocol Buffers (less code / lower -overhead), and Rapid JSON, one of the fastest C++ JSON parsers around. +overhead), Rapid JSON (one of the fastest C++ JSON parsers around), +and pugixml, also one of the fastest XML parsers. We compare against Flatbuffers with the binary wire format (as intended), and also with JSON as the wire format with the optional JSON @@ -13,17 +14,17 @@ The benchmark object is a set of about 10 objects containing an array, 4 strings, and a large variety of int/float scalar values of all sizes, meant to be representative of game data, e.g. a scene format. -| | FlatBuffers (binary) | Protocol Buffers LITE | Rapid JSON | FlatBuffers (JSON) | -|--------------------------------------------------------|-----------------------|-----------------------|-----------------------|-----------------------| -| Decode + Traverse + Dealloc (1 million times, seconds) | 0.08 | 302 | 583 | 105 | -| Decode / Traverse / Dealloc (breakdown) | 0 / 0.08 / 0 | 220 / 0.15 / 81 | 294 / 0.9 / 287 | 70 / 0.08 / 35 | -| Encode (1 million times, seconds) | 3.2 | 185 | 650 | 169 | -| Wire format size (normal / zlib, bytes) | 344 / 220 | 228 / 174 | 1475 / 322 | 1029 / 298 | -| Memory needed to store decoded wire (bytes / blocks) | 0 / 0 | 760 / 20 | 65689 / 40 | 328 / 1 | -| Transient memory allocated during decode (KB) | 0 | 1 | 131 | 4 | -| Generated source code size (KB) | 4 | 61 | 0 | 4 | -| Field access in handwritten traversal code | accessors | accessors | manual error checking | accessors | -| Library source code (KB) | 15 | some subset of 3800 | 87 | 43 | +| | FlatBuffers (binary) | Protocol Buffers LITE | Rapid JSON | FlatBuffers (JSON) | pugixml | +|--------------------------------------------------------|-----------------------|-----------------------|-----------------------|-----------------------| ----------------------| +| Decode + Traverse + Dealloc (1 million times, seconds) | 0.08 | 302 | 583 | 105 | 196 | +| Decode / Traverse / Dealloc (breakdown) | 0 / 0.08 / 0 | 220 / 0.15 / 81 | 294 / 0.9 / 287 | 70 / 0.08 / 35 | 41 / 3.9 / 150 | +| Encode (1 million times, seconds) | 3.2 | 185 | 650 | 169 | 273 | +| Wire format size (normal / zlib, bytes) | 344 / 220 | 228 / 174 | 1475 / 322 | 1029 / 298 | 1137 / 341 | +| Memory needed to store decoded wire (bytes / blocks) | 0 / 0 | 760 / 20 | 65689 / 4 | 328 / 1 | 34194 / 3 | +| Transient memory allocated during decode (KB) | 0 | 1 | 131 | 4 | 34 | +| Generated source code size (KB) | 4 | 61 | 0 | 4 | 0 | +| Field access in handwritten traversal code | typed accessors | typed accessors | manual error checking | typed accessors | manual error checking | +| Library source code (KB) | 15 | some subset of 3800 | 87 | 43 | 327 | ### Some other serialization systems we compared against but did not benchmark (yet), in rough order of applicability: @@ -36,8 +37,6 @@ meant to be representative of game data, e.g. a scene format. with the typed C++ interface. Also lacks VS2010 support. - Thrift: very similar to Protocol Buffers, but appears to be less efficient, and have more dependencies. -- XML: typically even slower than JSON, but has the advantage that it can be - parsed with a schema to reduce error-checking boilerplate code. - YAML: a superset of JSON and otherwise very similar. Used by e.g. Unity. - C# comes with built-in serialization functionality, as used by Unity also. Being tied to the language, and having no automatic versioning support