知识卡片
载荷成本包含解析时间
大载荷的成本不仅是网络字节数,还包括收发两端把数据解析成领域对象的时间。JSON 可读性有调试价值,但不能替代对真实语言运行时、载荷大小和追踪能力的测量;当流量规模增大,序列化与解析开销可能成为瓶颈。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Another factor in large payload exchanges is the time it takes components to parse the message content into language-level domain objects. Performance time of parsing data formats varies vastly depending on the language a service is implemented in. Many traditional server-side languages can struggle with JSON compared to a binary representation, for example. It is worth exploring the impact of parsing and include that consideration when choosing an exchange format.
参考来源
- 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《Large Exchange Payloads》(源文件:_epub-src/OEBPS/ch01.xhtml)
- 结论依据:原文分别讨论 JSON 文本体积、线上传输、现代追踪与语言实现中的解析开销,要求选择交换格式时一并评估。
- 原始内容:Another factor in large payload exchanges is the time it takes components to parse the message content into language-level domain objects. Performance time of parsing data formats varies vastly depending on the language a service is implemented in. Many traditional server-side languages can struggle with JSON compared to a binary representation, for example. It is worth exploring the impact of parsing and include that consideration when choosing an exchange format.