Skip to content
Snippets Groups Projects
  1. Jul 03, 2018
  2. Apr 27, 2018
  3. Jan 03, 2018
    • Stepan Koltsov's avatar
      Optimize shallow_clone for Bytes::split_{off,to} (#92) · 6a3d20bb
      Stepan Koltsov authored
      If `shallow_clone` is called with `&mut self`, and `Bytes` contains
      `Vec`, then expensive CAS can be avoided, because no other thread
      have references to this `Bytes` object.
      
      Bench `split_off_and_drop` difference:
      
      Before the diff:
      
      ```
      test split_off_and_drop             ... bench:      91,858 ns/iter (+/- 17,401)
      ```
      
      With the diff:
      
      ```
      test split_off_and_drop             ... bench:      81,162 ns/iter (+/- 17,603)
      ```
      6a3d20bb
  4. Jul 01, 2017
    • Stepan Koltsov's avatar
      Optimize Bytes::slice for short slices (#136) · b9ccd2a8
      Stepan Koltsov authored
      Slice operation should return inline when possible
      
      It is cheaper than atomic increment/decrement.
      
      Before this patch:
      
      ```
      test slice_avg_le_inline_from_arc   ... bench:      28,582 ns/iter (+/- 3,880)
      test slice_empty                    ... bench:       8,797 ns/iter (+/- 1,325)
      test slice_large_le_inline_from_arc ... bench:      27,684 ns/iter (+/- 5,920)
      test slice_short_from_arc           ... bench:      27,439 ns/iter (+/- 5,783)
      ```
      
      After this patch:
      
      ```
      test slice_avg_le_inline_from_arc   ... bench:      18,872 ns/iter (+/- 2,937)
      test slice_empty                    ... bench:       9,136 ns/iter (+/- 1,908)
      test slice_large_le_inline_from_arc ... bench:      18,052 ns/iter (+/- 2,981)
      test slice_short_from_arc           ... bench:      18,200 ns/iter (+/- 2,534)
      ```
      b9ccd2a8
  5. Jun 15, 2017
  6. May 22, 2017
    • Stepan Koltsov's avatar
      Optimize Bytes::slice(n, n) (#123) · 3f5890be
      Stepan Koltsov authored
      Return empty `Bytes` object
      
      Bench for `slice_empty` difference is
      
      ```
      55 ns/iter (+/- 1) # before this patch
      17 ns/iter (+/- 5) # with this patch
      ```
      
      Bench for `slice_not_empty` is
      
      ```
      25,058 ns/iter (+/- 1,099) # before this patch
      25,072 ns/iter (+/- 1,593) # with this patch
      ```
      3f5890be
    • Carl Lerche's avatar
      Fix benchmarks · 70ee87ea
      Carl Lerche authored
      70ee87ea
  7. Feb 20, 2017
    • Carl Lerche's avatar
      Rewrite `Bytes` / `BytesMut` core implementation · cf5a1bc4
      Carl Lerche authored
      The previous implementation didn't factor in a single `Bytes` handle
      being stored in an `Arc`. This new implementation correctly impelments
      both `Bytes` and `BytesMut` such that both are `Sync`.
      
      The rewrite also increases the number of bytes that can be stored
      inline.
      cf5a1bc4
Loading