summaryrefslogtreecommitdiffstats
path: root/gfx/wr/peek-poke/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /gfx/wr/peek-poke/README.md
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/peek-poke/README.md')
-rw-r--r--gfx/wr/peek-poke/README.md54
1 files changed, 54 insertions, 0 deletions
diff --git a/gfx/wr/peek-poke/README.md b/gfx/wr/peek-poke/README.md
new file mode 100644
index 0000000000..1c379aa121
--- /dev/null
+++ b/gfx/wr/peek-poke/README.md
@@ -0,0 +1,54 @@
+# Peeks, Pokes, and Pointers
+
+Peek from and poke structures into byte slices.
+
+## Benchmark
+
+Below are the benchmark results of comparison between `peek-poke` and `bincode` serializing and deserializing same `struct`:
+```
+struct MyPeekPokeStruct {
+ a: u8,
+ b: u16,
+ c: MyPeekPokeEnum,
+ d: Option<usize>,
+}
+
+enum MyPeekPokeEnum {
+ Variant1,
+ Variant2(u16),
+}
+```
+
+```
+Benchmarking struct::serialize/peek_poke::poke_into: Collecting 100 samples in struct::serialize/peek_poke::poke_into
+ time: [2.7267 ns 2.7321 ns 2.7380 ns]
+
+Benchmarking struct::serialize/bincode::serialize: Collecting 100 samples in est struct::serialize/bincode::serialize
+ time: [31.264 ns 31.326 ns 31.389 ns]
+
+Benchmarking struct::deserialize/peek_poke::peek_from: Collecting 100 samples struct::deserialize/peek_poke::peek_from
+ time: [5.3544 ns 5.3672 ns 5.3817 ns]
+
+Benchmarking struct::deserialize/bincode::deserialize: Collecting 100 samples in struct::deserialize/bincode::deserialize
+ time: [25.155 ns 26.439 ns 27.661 ns]
+```
+
+You can run benchmarks by running following command:
+```
+cargo bench
+```
+
+## License
+[license]: #license
+
+Licensed under either of
+- Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
+- MIT license (http://opensource.org/licenses/MIT)
+
+at your option.
+
+see [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details.
+
+## Contribution
+Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as
+defined in the Apache-2.0 license, shall be dual licensed as about, without any additional terms or conditions.