| commit | 24f810e5c79c02a20890467e8ae25ab6b064d9a7 | [log] [tgz] |
|---|---|---|
| author | Mitchell Kember <mkember@fuchsia.infra.roller.google.com> | Wed May 25 19:42:28 2022 +0000 |
| committer | Copybara-Service <copybara-worker@google.com> | Wed May 25 12:44:00 2022 -0700 |
| tree | 237735ed3cd79b90796b82d220381bd746980922 | |
| parent | adf6a68171b6fa84c953955c365ec2b3cd8cbd6e [diff] |
[roll] Roll fuchsia [rust][fidl] Elide more bounds checks in release mode This CL changes most `self.buf[i]` array accesses to use `get_unchecked` or `get_unchecked_mut`, moving bounds checks to `debug_assert!` instead. This was already how most of the encoding/decoding logic worked. There was no particular reason to keep the bounds checks in these helpers. Note that I did not mark these functions unsafe because "the caller does bounds checks" is an assumption throughout this file. For example, calling field.encode(...) or field.decode(...) works the same way and requires equal scrutiny. For more context on these decisions, see Id4c9e44b21d94e9c7994696808db7eac3c7baac7. Benchmark results: Test case Improve/regress? Factor change Mean before Mean after ------------------------------------------------------ ---------------- ------------- ------------------- -------------------- LLCPP/Decode/HandleArray/Plain/64/Steps.Setup/WallTime faster 0.992-1.000 76727 +/- 205 ns 76404 +/- 88 ns Rust/Builder/DatagramSocket/RecvMsg/Request/WallTime faster 0.466-0.684 2.10 +/- 0.39 ns 1.1629 +/- 0.0029 ns Rust/Decode/ByteArray/16/WallTime faster 0.465-0.834 18.5 +/- 2.3 ns 11.6 +/- 1.9 ns Rust/Decode/ByteVector/16/WallTime slower 1.009-1.034 119.57 +/- 0.32 ns 122.2 +/- 1.2 ns Rust/Decode/Table/AllSet/63/WallTime faster 0.809-0.881 560.5 +/- 6.1 ns 473 +/- 15 ns Rust/Decode/Table/SingleSet/16_of_63/WallTime faster 0.837-0.957 99.2 +/- 4.6 ns 88.7 +/- 1.8 ns Rust/Decode/Union/LastSet/1/WallTime faster 0.911-0.966 20.82 +/- 0.35 ns 19.53 +/- 0.25 ns Rust/Decode/Union/LastSet/16/WallTime faster 0.829-1.000 27.9 +/- 2.1 ns 25.38 +/- 0.49 ns Rust/Encode/ByteVector/16/WallTime faster 0.861-0.916 45.66 +/- 0.96 ns 40.56 +/- 0.40 ns Rust/Encode/DatagramSocket/RecvMsg/Request/WallTime faster 0.920-0.944 23.468 +/- 0.099 ns 21.86 +/- 0.19 ns Rust/Encode/DatagramSocket/SendMsg2/Result/WallTime faster 0.962-0.991 39.25 +/- 0.21 ns 38.32 +/- 0.37 ns Rust/Encode/EmptyStruct/WallTime faster 0.916-0.939 22.12 +/- 0.15 ns 20.52 +/- 0.11 ns Rust/Encode/EnumArray/NonDense/256/WallTime faster 0.924-0.961 877.6 +/- 9.3 ns 827.1 +/- 7.5 ns Rust/Encode/ErrorSyntaxResult_Failure/WallTime faster 0.925-0.976 38.71 +/- 0.78 ns 36.79 +/- 0.24 ns Rust/Encode/HandleArray/Event/64/WallTime slower 1.010-1.037 1755 +/- 12 ns 1796 +/- 12 ns Rust/Encode/String/16/WallTime faster 0.951-0.998 45.08 +/- 0.75 ns 43.92 +/- 0.32 ns Rust/Encode/StructField/16/WallTime faster 0.958-0.975 21.917 +/- 0.100 ns 21.179 +/- 0.086 ns Rust/Encode/Table/AllSet/63/WallTime faster 0.947-0.989 1127.2 +/- 1.5 ns 1091 +/- 22 ns Rust/Encode/Table/LastSetOthersReserved/16/WallTime slower 1.007-1.014 62.73 +/- 0.14 ns 63.408 +/- 0.081 ns Rust/Encode/Table/LastSetOthersReserved/63/WallTime slower 1.000-1.102 68.13 +/- 0.13 ns 71.6 +/- 3.3 ns Rust/Encode/Table/SingleSet/16_of_63/WallTime faster 0.934-0.949 246.21 +/- 0.81 ns 231.8 +/- 1.0 ns Rust/Encode/Table/SingleSet/63_of_63/WallTime faster 0.928-0.936 777.7 +/- 1.8 ns 724.8 +/- 1.3 ns Rust/Encode/Union/LastSet/1/WallTime faster 0.944-0.959 40.121 +/- 0.062 ns 38.18 +/- 0.24 ns Rust/Encode/Union/LastSet/16/WallTime slower 1.011-1.018 38.584 +/- 0.060 ns 39.153 +/- 0.069 ns Rust/Encode/Union/LastSet/256/WallTime faster 0.962-0.971 41.686 +/- 0.081 ns 40.30 +/- 0.11 ns Test: fx test fidl_rust_conformance_tests Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/683140 Original-Revision: 500af410225fde728cd0975b8a43f8f9aaf7b458 GitOrigin-RevId: 195d15879c9ca0c40a233317b59e8315ebea8b4d Change-Id: I058b5bd5378f16e4f0448b7d02ac001ddf2dc3ac
This repository contains Fuchsia's Global Integration manifest files.
All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.
Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.
First install Jiri.
Next run:
$ jiri init $ jiri import minimal https://fuchsia.googlesource.com/integration $ jiri update
Third party projects should have their own subdirectory in ./third_party.