commit | 9015c75c5921e3fc3f90a506db48537f40ae1cc6 | [log] [tgz] |
---|---|---|
author | Benjamin Prosnitz <bprosnitz@google.com> | Tue Jul 14 11:33:42 2020 +0000 |
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | Tue Jul 14 11:33:42 2020 +0000 |
tree | a8107bd1cfc1a0f476ae539db8819f6dd10b0794 | |
parent | 301308d034367a22bb48f1fbabdb891cd26a8784 [diff] |
[fidl][rust] Use fidl_struct_copy! macro where possible fidl_struct_copy! is a new rust macro that directly copies structs when: - There is no padding - The struct entirely consists of primitives and structs consisting of primitives (recursively) It is potentially possible to extend this to structs containing arrays, which would be useful for types like MessageHeader but it is not currently supported by zerocopy. This reduces binary size by 20480 bytes Summary of performance change: (others have small percentage difference) Rust/Decode/MessageHeader/WallTime faster 0.462-0.471 80.88 +/- 0.12 ns 37.76 +/- 0.30 ns Rust/Decode/StructField/16/WallTime faster 0.198-0.203 186.24 +/- 0.13 ns 37.27 +/- 0.46 ns Rust/Decode/StructField/256/WallTime faster 0.019-0.021 2813 +/- 12 ns 56.7 +/- 1.8 ns Rust/Decode/StructTree/Depth8/WallTime faster 0.010-0.011 5571.7 +/- 7.9 ns 58.3 +/- 1.3 ns Rust/Encode/MessageHeader/WallTime faster 0.608-0.617 87.73 +/- 0.38 ns 53.76 +/- 0.17 ns Rust/Encode/StructField/16/WallTime faster 0.334-0.338 166.90 +/- 0.33 ns 56.06 +/- 0.26 ns Rust/Encode/StructField/256/WallTime faster 0.033-0.034 1908.4 +/- 3.5 ns 63.99 +/- 0.24 ns Rust/Encode/StructTree/Depth8/WallTime faster 0.021-0.021 3002.8 +/- 2.9 ns 62.66 +/- 0.29 ns Test: existing rust conformance tests Change-Id: I2ca8eb624b36011f0835e09a207fb3d62d626b48 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/403333 Reviewed-by: Tyler Mandry <tmandry@google.com> Reviewed-by: Mitchell Kember <mkember@google.com> Commit-Queue: Benjamin Prosnitz <bprosnitz@google.com> Testability-Review: Mitchell Kember <mkember@google.com>
Pink + Purple == Fuchsia (a new operating system)
Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.
Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.
See Getting Started.
See fuchsia.dev.