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

std.unicode fixes #3987

Merged
merged 5 commits into from
Dec 28, 2019
Merged

std.unicode fixes #3987

merged 5 commits into from
Dec 28, 2019

Commits on Dec 28, 2019

  1. Configuration menu
    Copy the full SHA
    a81c0ba View commit details
    Browse the repository at this point in the history
  2. std: add warm up phase to benchmark

    In my tests, whatever ran first was getting much better numbers.
    Additionally, add alignment requirements so that comparison is fair.
    daurnimator committed Dec 28, 2019
    Configuration menu
    Copy the full SHA
    8b72eed View commit details
    Browse the repository at this point in the history
  3. std: optimise utf8ByteSequenceLength

    Also tested (but not as fast):
    ```zig
    pub fn utf8ByteSequenceLength(first_byte: u8) !u3 {
        const len = @clz(u8, ~first_byte);
        if (len == 0) return 1;
        if (len < 4) return @intcast(u3, len);
        return error.Utf8InvalidStartByte;
    }
    ```
    daurnimator committed Dec 28, 2019
    Configuration menu
    Copy the full SHA
    5843a6e View commit details
    Browse the repository at this point in the history
  4. std: simplify utf8ToUtf16Le

    Also faster, on my machine unicode/throughput_test.zig now gives e.g.
    > original utf8ToUtf16Le: elapsed: 1048 ns (0 ms)
    > new utf8ToUtf16Le: elapsed: 971 ns (0 ms)
    daurnimator committed Dec 28, 2019
    Configuration menu
    Copy the full SHA
    ab60654 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    edb5deb View commit details
    Browse the repository at this point in the history