mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
08943aa26fe9f5ff960e2b102435c7624347446e
UnpackTo copies vector elements one-by-one, which can be very inefficient depending on the quality of the compiler optimizations performed. This change updates the operation for vectors of bytes that aren't enums to use 'std::copy', which is usually highly optimized. vectors of types that are more than one byte can't be optimized in this way because of the endianness of the serialized bytes vs. the target architecture endianness. vectors of enums can't be optimized because they are required to be static_cast into the appropriate enum type when stored in the vector. vectors of bools can be optimized in most cases, but since the standard allows std::vector<bool> template specialization for space-savings, std::copy doesn't work on every implementation (looking at you Microsoft). Thus, this optimization is skipped for vector<bool>. For a specific example, this improves the latency of unpacking large buffers on the Hexagon DSP by about 10x. Co-authored-by: Matthew Markwell <markwell@google.com>
FlatBuffers
FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.
Go to our landing page to browse our documentation.
Supported operating systems
- Windows
- MacOS X
- Linux
- Android
- And any others with a recent C++ compiler.
Supported programming languages
- C++
- C#
- C
- Dart
- Go
- Java
- JavaScript
- Lobster
- Lua
- PHP
- Python
- Rust
- TypeScript
and more in progress...
Contribution
- FlatBuffers Google Group to discuss FlatBuffers with other developers and users.
- FlatBuffers Issues Tracker to submit an issue.
- stackoverflow.com with
flatbufferstag for any questions regarding FlatBuffers.
To contribute to this project, see CONTRIBUTING.
Licensing
Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
Description
FlatBuffers: Memory Efficient Serialization Library
cc-plus-pluscross-platformc-sharpflatbuffersgogrpcjavajavascriptjson-parsermarshallingmmapprotobufpythonrpcrustserializationserialization-librarytypescriptzero-copy
Readme
Apache-2.0
79 MiB
Languages
C++
37.8%
Rust
13.5%
Swift
7.7%
Python
6.9%
C#
5.6%
Other
28.5%