Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimize unsafe usage and rework line wrapping #31

Merged
merged 12 commits into from
May 22, 2017
Merged

Minimize unsafe usage and rework line wrapping #31

merged 12 commits into from
May 22, 2017

Commits on Apr 30, 2017

  1. Configuration menu
    Copy the full SHA
    0c15adf View commit details
    Browse the repository at this point in the history
  2. Rewrite line wrapping to use a linear-time algo.

    Encoded bytes are moved from the end to the front so each byte is
    only moved once.
    
    Encoding is somewhat rearranged to operate on a slice into the
    output buffer. This makes it easier to avoid clobbering any
    existing bytes in the buffer, as well as paving the way to slice-
    based encoding needed for a Display wrapper, stream adapters, etc.
    marshallpierce committed Apr 30, 2017
    Configuration menu
    Copy the full SHA
    f775196 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2017

  1. Configuration menu
    Copy the full SHA
    adfde3c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a72d575 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1683292 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2017

  1. Minimize unsafe use on the basic encode code path.

    At the cost of a 30% encode speed hit, the only unsafe used outside
    of line wrapping is to view the output buffer as a Vec<u8>.
    Marshall Pierce committed May 5, 2017
    Configuration menu
    Copy the full SHA
    cab488a View commit details
    Browse the repository at this point in the history

Commits on May 6, 2017

  1. Help the optimizer by making some intermediate slices.

    Hand unroll the main encode loop 4x. 8x was barely better on longer
    inputs, but only barely, and it hurt shorter inputs that then couldn't
    enter the loop at all.
    Marshall Pierce committed May 6, 2017
    Configuration menu
    Copy the full SHA
    eeb9f5c View commit details
    Browse the repository at this point in the history
  2. Use safemem's ptr::copy wrapper in line_wrap.

    Marshall Pierce committed May 6, 2017
    Configuration menu
    Copy the full SHA
    184bf14 View commit details
    Browse the repository at this point in the history

Commits on May 8, 2017

  1. Use a const for number of blocks per encode fast loop

    Marshall Pierce committed May 8, 2017
    Configuration menu
    Copy the full SHA
    b698641 View commit details
    Browse the repository at this point in the history

Commits on May 9, 2017

  1. Tests ensuring that encoding and padding produce utf8.

    Marshall Pierce committed May 9, 2017
    Configuration menu
    Copy the full SHA
    bb31229 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2017

  1. Syntactic tidying, plus removing some tests.

    The old tests that exhaustively check strings a couple bytes long
    weren't that useful, and only checked one config. Using the random
    config helper in src/tests.rs is a better use of wall clock time
    when waiting for tests to run.
    marshallpierce committed May 18, 2017
    Configuration menu
    Copy the full SHA
    91366d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ed5dde View commit details
    Browse the repository at this point in the history