跳到主要内容
版本:1.3.0

Fory Swift 基准

该基准比较 Apache Fory、Protocol Buffers 和 JSON 在 Swift 中的序列化与反序列化吞吐量。

吞吐图表​

Throughput

硬件与运行时信息​

键值
时间戳2026-05-08T09:05:32Z
操作系统Version 15.7.2 (Build 24G325)
主机macbook-pro.local
CPU 核心数(逻辑)12
内存(GB)48.00
每个用例持续时长(秒)3

吞吐结果​

数据类型操作Fory TPSProtobuf TPSJSON TPS最快
NumericStruct序列化9,435,6236,175,939408,960fory (1.53x)
NumericStruct反序列化11,037,2256,842,676328,302fory (1.61x)
Sample序列化3,596,8351,257,10079,781fory (2.86x)
Sample反序列化982,255733,58841,274fory (1.34x)
MediaContent序列化1,561,376609,89698,677fory (2.56x)
MediaContent反序列化523,836395,20270,528fory (1.33x)
NumericStructList序列化2,910,846918,36382,965fory (3.17x)
NumericStructList反序列化2,436,636701,65669,353fory (3.47x)
SampleList序列化694,557202,04016,679fory (3.44x)
SampleList反序列化187,109131,9478,236fory (1.42x)
MediaContentList序列化348,23898,00718,698fory (3.55x)
MediaContentList反序列化104,99074,42216,298fory (1.41x)

序列化大小(字节)​

数据类型ForyProtobufJSON
NumericStruct7893159
Sample445375696
MediaContent362301608
NumericStructList255475816
SampleList197818903501
MediaContentList153115203067