Fory Swift Benchmark

August 4, 2026 ยท View on GitHub

This benchmark compares serialization and deserialization throughput for Apache Fory, Protocol Buffers, and JSON in Swift.

Benchmark Scope

The results below cover the ordinary/xlang cases run by swift-benchmark. External-type and carrier comparisons use the separate swift-external-benchmark executable and are included only when requested.

Throughput Plot

Throughput

Hardware and Runtime Info

KeyValue
Timestamp2026-08-04T09:52:12Z
OSVersion 15.7.2 (Build 24G325)
HostMacBook-Pro.local
CPU Cores (Logical)12
Memory (GB)48.00
Duration per case (s)3

Throughput Results

DatatypeOperationFory TPSProtobuf TPSJSON TPSFastest
NumericStructSerialize14,759,6067,572,190481,278fory (1.95x)
NumericStructDeserialize18,155,7957,317,942377,802fory (2.48x)
SampleSerialize5,633,2311,380,130102,372fory (4.08x)
SampleDeserialize1,509,740916,62652,897fory (1.65x)
MediaContentSerialize2,987,821784,863111,200fory (3.81x)
MediaContentDeserialize1,072,345549,72697,799fory (1.95x)
NumericStructListSerialize5,515,7691,093,92493,635fory (5.04x)
NumericStructListDeserialize2,598,609746,52776,161fory (3.48x)
SampleListSerialize1,201,868220,77220,772fory (5.44x)
SampleListDeserialize286,949161,19210,777fory (1.78x)
MediaContentListSerialize657,276118,00422,744fory (5.57x)
MediaContentListDeserialize215,72699,44519,521fory (2.17x)

Serialized Size (bytes)

DatatypeForyProtobufJSON
NumericStruct7893159
Sample445375696
MediaContent362301608
NumericStructList255475816
SampleList197818903501
MediaContentList153115203067