json_in_type:rust中的快速json编码器,可按其类型对JSON值的结构进行编码

时间:2021-03-19 16:30:53
【文件属性】:
文件名称:json_in_type:rust中的快速json编码器,可按其类型对JSON值的结构进行编码
文件大小:28KB
文件格式:ZIP
更新时间:2021-03-19 16:30:53
rust json performance Rust json_in_type rust中的快速json编码器,在编译时执行更多操作,在运行时执行较少操作。一个值得注意的功能是能够以其类型对JSON对象的结构进行编码。 与在JSON对象存储在地图中的传统方法(例如,由serde的json! marco使用)相比,这允许在内存中非常紧凑地表示对象,并且性能提高了一个数量级。 该库的目标是通过在源代码中手动编写json并使用字符串格式插入动态值来尽可能接近性能和内存占用。 fn write_obj_bad (value: f32 ) -> String { format! ( "{{ \" value \" :{}}}" , value) } // Safer, but equivalent and not less efficient : fn write_obj_good (value: f32 ) -> String {
【文件预览】:
json_in_type-master
----Cargo.toml(894B)
----Cargo.lock(26KB)
----src()
--------base_types.rs(3KB)
--------object.rs(11KB)
--------utils.rs(725B)
--------bin.rs(375B)
--------string.rs(8KB)
--------lib.rs(3KB)
--------list.rs(7KB)
----.travis.yml(1KB)
----LICENSE(1KB)
----README.md(5KB)
----tests()
--------macros.rs(2KB)
--------simple_example.rs(344B)
----.gitignore(51B)
----json_in_type_derive()
--------Cargo.toml(419B)
--------Cargo.lock(3KB)
--------src()
--------README.md(587B)
--------tests()
--------.gitignore(8B)
----benches()
--------json_encoding.rs(5KB)

网友评论