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

Decoder: use lookup table to validate ASCII #654

Merged
merged 1 commit into from Nov 4, 2021
Merged

Decoder: use lookup table to validate ASCII #654

merged 1 commit into from Nov 4, 2021

Commits on Nov 4, 2021

  1. utf8: use lookup table to validate ASCII

    ```
    name                        old time/op    new time/op    delta
    ParseBasicStringsEasy/1-2     10.6ns ± 0%    10.3ns ± 0%   -2.90%  (p=0.016 n=4+5)
    ParseBasicStringsEasy/4-2     16.0ns ± 0%    14.8ns ± 0%   -7.31%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/8-2     23.8ns ± 1%    21.0ns ± 1%  -11.94%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/16-2    36.0ns ± 1%    32.0ns ± 3%  -11.04%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/21-2    44.9ns ± 1%    40.3ns ± 0%  -10.24%  (p=0.016 n=5+4)
    
    name                        old speed      new speed      delta
    ParseBasicStringsEasy/1-2    282MB/s ± 0%   290MB/s ± 0%   +2.98%  (p=0.016 n=4+5)
    ParseBasicStringsEasy/4-2    375MB/s ± 0%   405MB/s ± 0%   +7.89%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/8-2    420MB/s ± 1%   476MB/s ± 1%  +13.53%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/16-2   500MB/s ± 1%   562MB/s ± 3%  +12.47%  (p=0.008 n=5+5)
    ParseBasicStringsEasy/21-2   512MB/s ± 1%   573MB/s ± 2%  +11.81%  (p=0.008 n=5+5)
    
    name                               old time/op    new time/op    delta
    UnmarshalDataset/config-2            24.7ms ± 0%    24.5ms ± 0%  -1.04%  (p=0.008 n=5+5)
    UnmarshalDataset/canada-2            84.6ms ± 0%    85.1ms ± 2%    ~     (p=0.413 n=4+5)
    UnmarshalDataset/citm_catalog-2      25.8ms ± 2%    25.7ms ± 1%    ~     (p=1.000 n=5+5)
    UnmarshalDataset/twitter-2           9.53ms ± 0%    9.38ms ± 0%  -1.51%  (p=0.008 n=5+5)
    UnmarshalDataset/code-2               107ms ± 1%     107ms ± 1%    ~     (p=0.222 n=5+5)
    UnmarshalDataset/example-2            165µs ± 2%     163µs ± 0%  -1.06%  (p=0.016 n=5+4)
    Unmarshal/SimpleDocument/struct-2     574ns ± 1%     570ns ± 1%    ~     (p=0.056 n=5+5)
    Unmarshal/SimpleDocument/map-2        848ns ± 1%     845ns ± 0%    ~     (p=0.310 n=5+5)
    Unmarshal/ReferenceFile/struct-2     55.8µs ± 0%    54.0µs ± 0%  -3.24%  (p=0.008 n=5+5)
    Unmarshal/ReferenceFile/map-2        83.5µs ± 2%    81.0µs ± 0%  -2.98%  (p=0.008 n=5+5)
    Unmarshal/HugoFrontMatter-2          14.4µs ± 1%    14.2µs ± 0%  -1.48%  (p=0.008 n=5+5)
    
    name                               old speed      new speed      delta
    UnmarshalDataset/config-2          42.4MB/s ± 0%  42.9MB/s ± 0%  +1.05%  (p=0.008 n=5+5)
    UnmarshalDataset/canada-2          26.0MB/s ± 0%  25.9MB/s ± 1%    ~     (p=0.460 n=4+5)
    UnmarshalDataset/citm_catalog-2    21.6MB/s ± 2%  21.7MB/s ± 1%    ~     (p=0.952 n=5+5)
    UnmarshalDataset/twitter-2         46.4MB/s ± 0%  47.1MB/s ± 0%  +1.53%  (p=0.008 n=5+5)
    UnmarshalDataset/code-2            25.0MB/s ± 1%  25.1MB/s ± 1%    ~     (p=0.175 n=5+5)
    UnmarshalDataset/example-2         49.2MB/s ± 2%  49.7MB/s ± 0%  +1.07%  (p=0.016 n=5+4)
    Unmarshal/SimpleDocument/struct-2  19.2MB/s ± 1%  19.3MB/s ± 0%  +0.74%  (p=0.048 n=5+5)
    Unmarshal/SimpleDocument/map-2     13.0MB/s ± 1%  13.0MB/s ± 0%    ~     (p=0.254 n=5+5)
    Unmarshal/ReferenceFile/struct-2   94.0MB/s ± 0%  97.1MB/s ± 0%  +3.35%  (p=0.008 n=5+5)
    Unmarshal/ReferenceFile/map-2      62.8MB/s ± 2%  64.7MB/s ± 0%  +3.06%  (p=0.008 n=5+5)
    Unmarshal/HugoFrontMatter-2        37.9MB/s ± 1%  38.4MB/s ± 0%  +1.49%  (p=0.008 n=5+5)
    ```
    pelletier committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    19cde8c View commit details
    Browse the repository at this point in the history