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

rustdoc-search: tighter encoding for f index #119468

Merged
merged 4 commits into from Jan 6, 2024

Commits on Dec 31, 2023

  1. Configuration menu
    Copy the full SHA
    1ab60f2 View commit details
    Browse the repository at this point in the history
  2. rustdoc-search: tighter encoding for f index

    Two optimizations for the function signature search:
    
    * Instead of using JSON arrays, like `[1,20]`, it uses VLQ
      hex with no commas, like `[aAd]`.
    * This also adds backrefs: if you have more than one function
      with exactly the same signature, it'll not only store it once,
      it'll *decode* it once, and store in the typeIdMap only once.
    
    Size change
    -----------
    
    standard library
    
    ```console
    $ du -bs search-index-old.js search-index-new.js
    4976370 search-index-old.js
    4404391 search-index-new.js
    ```
    
    ((4976370-4404391)/4404391)*100% = 12.9%
    
    Benchmarks are similarly shrunk:
    
    ```console
    $ du -hs tmp/{arti,cortex-m,sqlx,stm32f4,ripgrep}/toolchain_{old,new}/doc/search-index.js
    10555067        tmp/arti/toolchain_old/doc/search-index.js
    8921236 tmp/arti/toolchain_new/doc/search-index.js
    77018   tmp/cortex-m/toolchain_old/doc/search-index.js
    66676   tmp/cortex-m/toolchain_new/doc/search-index.js
    2876330 tmp/sqlx/toolchain_old/doc/search-index.js
    2436812 tmp/sqlx/toolchain_new/doc/search-index.js
    63632890        tmp/stm32f4/toolchain_old/doc/search-index.js
    52337438        tmp/stm32f4/toolchain_new/doc/search-index.js
    631150  tmp/ripgrep/toolchain_old/doc/search-index.js
    541646  tmp/ripgrep/toolchain_new/doc/search-index.js
    ```
    notriddle committed Dec 31, 2023
    Configuration menu
    Copy the full SHA
    86b9550 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2024

  1. Configuration menu
    Copy the full SHA
    a68ac32 View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2024

  1. Configuration menu
    Copy the full SHA
    004bfc5 View commit details
    Browse the repository at this point in the history