diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index b7efcee..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,4 +0,0 @@ -# https://github.com/rui314/mold?tab=readme-ov-file#how-to-use -[target.'cfg(target_os = "linux")'] -linker = "clang" -rustflags = ["-C", "link-arg=-fuse-ld=mold"] diff --git a/.github/assets/demo.png b/.github/assets/demo.png index 137b845..945e489 100644 Binary files a/.github/assets/demo.png and b/.github/assets/demo.png differ diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index a1067c4..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: 2 -updates: - # Update Cargo deps - - package-ecosystem: cargo - directory: "/" - schedule: - interval: "weekly" - - # Update used workflows - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - diff --git a/.github/workflows/hotpath-comment.yml b/.github/workflows/hotpath-comment.yml deleted file mode 100644 index a5ff678..0000000 --- a/.github/workflows/hotpath-comment.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: hotpath-comment - -on: - workflow_run: - workflows: ["hotpath-profile"] - types: - - completed - -permissions: - contents: read - pull-requests: write - -jobs: - comment: - runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Download profiling results - uses: actions/download-artifact@v7 - with: - name: hotpath-results - path: /tmp/ - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Install hotpath CLI - run: cargo install hotpath - - - name: Post timing comparison comment - env: - GH_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - HEAD_METRICS=$(cat /tmp/head_timing.json) - BASE_METRICS=$(cat /tmp/base_timing.json) - PR_NUMBER=$(cat /tmp/pr_number.txt) - hotpath profile-pr \ - --head-metrics "$HEAD_METRICS" \ - --base-metrics "$BASE_METRICS" \ - --github-token "$GH_TOKEN" \ - --pr-number "$PR_NUMBER" - - - name: Post allocation comparison comment - env: - GH_TOKEN: ${{ github.token }} - run: | - set -euo pipefail - HEAD_METRICS=$(cat /tmp/head_alloc.json) - BASE_METRICS=$(cat /tmp/base_alloc.json) - PR_NUMBER=$(cat /tmp/pr_number.txt) - hotpath profile-pr \ - --head-metrics "$HEAD_METRICS" \ - --base-metrics "$BASE_METRICS" \ - --github-token "$GH_TOKEN" \ - --pr-number "$PR_NUMBER" diff --git a/.github/workflows/hotpath-profile.yml b/.github/workflows/hotpath-profile.yml deleted file mode 100644 index f79b668..0000000 --- a/.github/workflows/hotpath-profile.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: hotpath-profile - -on: - pull_request: - branches: [ "main" ] - -env: - CARGO_TERM_COLOR: always - -jobs: - profile: - runs-on: ubuntu-latest - - steps: - - name: Checkout PR HEAD - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - - - name: Run timing profiling on HEAD - env: - HOTPATH_JSON: "true" - run: | - cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_timing.json - - - name: Run allocation profiling on HEAD - env: - HOTPATH_JSON: "true" - run: | - cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_alloc.json - - - name: Checkout base branch - run: | - git checkout ${{ github.event.pull_request.base.sha }} - - - name: Run timing profiling on base - env: - HOTPATH_JSON: "true" - run: | - cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_timing.json || echo '{}' > /tmp/base_timing.json - - - name: Run allocation profiling on base - env: - HOTPATH_JSON: "true" - run: | - cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_alloc.json || echo '{}' > /tmp/base_alloc.json - - - name: Save PR number - run: | - echo '${{ github.event.pull_request.number }}' > /tmp/pr_number.txt - - - name: Upload profiling results - uses: actions/upload-artifact@v6 - with: - name: hotpath-results - path: | - /tmp/head_timing.json - /tmp/head_alloc.json - /tmp/base_timing.json - /tmp/base_alloc.json - /tmp/pr_number.txt - retention-days: 1 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5f435fb..e87e1da 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,45 +10,12 @@ env: CARGO_TERM_COLOR: always jobs: - test: - name: Test on ${{ matrix.target }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - - os: ubuntu-latest - target: aarch64-unknown-linux-gnu + build: + + runs-on: ubuntu-latest steps: - name: "Checkout" - uses: actions/checkout@v6 - - - name: "Setup Rust toolchain" - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: ${{ matrix.target }} - - - name: "Install cross-compilation tools" - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - - - name: "Configure linker for aarch64" - if: matrix.target == 'aarch64-unknown-linux-gnu' - run: | - mkdir -p .cargo - cat >> .cargo/config.toml << EOF - [target.aarch64-unknown-linux-gnu] - linker = "aarch64-linux-gnu-gcc" - EOF - - - name: "Build" - run: cargo build --verbose --target ${{ matrix.target }} - - - name: "Run tests" - if: matrix.target == 'x86_64-unknown-linux-gnu' - run: cargo test --verbose --target ${{ matrix.target }} + uses: actions/checkout@v4 + - name: "Build with Cargo" + run: cargo build --verbose diff --git a/.gitignore b/.gitignore index 8799178..8ea0ee8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /target result* -/.direnv diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 9d5c77e..0000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,26 +0,0 @@ -condense_wildcard_suffixes = true -doc_comment_code_block_width = 80 -edition = "2024" # Keep in sync with Cargo.toml. -enum_discrim_align_threshold = 60 -force_explicit_abi = false -force_multiline_blocks = true -format_code_in_doc_comments = true -format_macro_matchers = true -format_strings = true -group_imports = "StdExternalCrate" -hex_literal_case = "Upper" -imports_granularity = "Crate" -imports_layout = "HorizontalVertical" -inline_attribute_width = 60 -match_block_trailing_comma = true -max_width = 80 -newline_style = "Unix" -normalize_comments = true -normalize_doc_attributes = true -overflow_delimited_expr = true -struct_field_align_threshold = 60 -tab_spaces = 2 -unstable_features = true -use_field_init_shorthand = true -use_try_shorthand = true -wrap_comments = true diff --git a/.taplo.toml b/.taplo.toml deleted file mode 100644 index 5a6456b..0000000 --- a/.taplo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[formatting] -align_entries = true -column_width = 100 -compact_arrays = false -reorder_inline_tables = true -reorder_keys = true - -[[rule]] -include = [ "**/Cargo.toml" ] -keys = [ "package" ] - -[rule.formatting] -reorder_keys = false diff --git a/Cargo.lock b/Cargo.lock index 065eded..1f39265 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,138 +1,48 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 4 +version = 3 [[package]] -name = "aho-corasick" -version = "1.1.3" +name = "addr2line" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "memchr", + "gimli", ] [[package]] -name = "alloca" -version = "0.4.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "backtrace" +version = "0.3.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ + "addr2line", "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" -dependencies = [ - "anstyle", - "once_cell_polyfill", - "windows-sys 0.61.2", -] - -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - -[[package]] -name = "ascii" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "bitflags" -version = "2.9.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cc" -version = "1.2.46" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97463e1064cb1b1c1384ad0a0b9c8abd0988e2a91f52606c80ef14aadb63e36" -dependencies = [ - "find-msvc-tools", - "shlex", -] +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" [[package]] name = "cfg-if" @@ -141,201 +51,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chunked_transfer" -version = "1.5.0" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] -name = "ciborium" -version = "0.2.2" +name = "color-eyre" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", + "backtrace", + "eyre", + "indenter", + "once_cell", + "owo-colors", ] -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "4.5.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "4.5.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "colored" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "criterion" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d883447757bb0ee46f233e9dc22eb84d93a9508c9b868687b274fc431d886bf" -dependencies = [ - "alloca", - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "itertools", - "num-traits", - "oorandom", - "page_size", - "plotters", - "rayon", - "regex", - "serde", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed943f81ea2faa8dcecbbfa50164acf95d555afec96a27871663b300e387b2e4" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - -[[package]] -name = "crunchy" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "either" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" - -[[package]] -name = "encode_unicode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" - [[package]] name = "eyre" version = "0.6.12" @@ -347,224 +80,22 @@ dependencies = [ ] [[package]] -name = "find-msvc-tools" -version = "0.1.5" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-macro", - "futures-sink", - "futures-task", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "half" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" -dependencies = [ - "cfg-if", - "crunchy", -] - -[[package]] -name = "hdrhistogram" -version = "7.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" -dependencies = [ - "byteorder", - "num-traits", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - -[[package]] -name = "hotpath" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bff4650da2df45a71a2f5c2c51fdcd5bea79270e0cc2a9984942d57fc77c0d7" -dependencies = [ - "arc-swap", - "base64", - "cfg-if", - "clap", - "colored", - "crossbeam-channel", - "eyre", - "futures-util", - "hdrhistogram", - "hotpath-macros", - "libc", - "mach2", - "pin-project-lite", - "prettytable-rs", - "quanta", - "regex", - "serde", - "serde_json", - "tiny_http", - "tokio", -] - -[[package]] -name = "hotpath-macros" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8d87ff506da0e93bac1a7ba104aa79fac048edab9d8ef922e75ba54106ee3d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "indenter" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964de6e86d545b246d84badc0fef527924ace5134f30641c203ef52ba83f58d5" - -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" - -[[package]] -name = "js-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "libc" -version = "0.2.178" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" - -[[package]] -name = "libredox" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" -dependencies = [ - "bitflags", - "libc", -] - -[[package]] -name = "log" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" - -[[package]] -name = "mach2" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "memchr" @@ -574,566 +105,56 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "microfetch" -version = "0.4.12" +version = "0.3.5" dependencies = [ - "criterion", - "hotpath", + "color-eyre", + "nix", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", "libc", ] [[package]] -name = "num-traits" -version = "0.2.19" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "autocfg", + "memchr", ] [[package]] name = "once_cell" -version = "1.21.3" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "once_cell_polyfill" -version = "1.70.2" +name = "owo-colors" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] -name = "oorandom" -version = "11.1.5" +name = "rustc-demangle" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - -[[package]] -name = "page_size" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - -[[package]] -name = "prettytable-rs" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" -dependencies = [ - "encode_unicode", - "is-terminal", - "lazy_static", - "term", - "unicode-width", -] - -[[package]] -name = "proc-macro2" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quanta" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi", - "web-sys", - "winapi", -] - -[[package]] -name = "quote" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "raw-cpuid" -version = "11.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" -dependencies = [ - "bitflags", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "rustversion" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "serde" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.219" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.140" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "syn" -version = "2.0.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiny_http" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82" -dependencies = [ - "ascii", - "chunked_transfer", - "httpdate", - "log", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "tokio" -version = "1.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" -dependencies = [ - "pin-project-lite", -] - -[[package]] -name = "unicode-ident" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasm-bindgen" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" diff --git a/Cargo.toml b/Cargo.toml index f6ddf6f..347b0bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,68 +1,24 @@ [package] -name = "microfetch" -version = "0.4.12" -edition = "2024" - -[lib] -name = "microfetch_lib" -path = "src/lib.rs" - -[[bin]] name = "microfetch" -path = "src/main.rs" +version = "0.3.5" +edition = "2021" [dependencies] -hotpath = { optional = true, version = "0.9.0" } -libc = "0.2.178" - -[dev-dependencies] -criterion = "0.8.1" - -[features] -hotpath = [ "dep:hotpath", "hotpath/hotpath" ] -hotpath-alloc = [ "hotpath/hotpath-alloc" ] -hotpath-off = [ "hotpath/hotpath-off" ] - -[[bench]] -harness = false -name = "benchmark" +nix = { version = "0.29", features = ["fs", "hostname", "feature"] } +color-eyre = { version = "0.6", default-features = false } [profile.dev] -opt-level = 1 +opt-level = 3 [profile.release] +strip = true +opt-level = "z" +lto = true codegen-units = 1 -lto = true -opt-level = "s" -panic = "abort" -strip = true +panic = "abort" [profile.profiler] -debug = true -inherits = "release" +inherits = "release" +debug = true split-debuginfo = "unpacked" -strip = "none" - -[lints.clippy] -complexity = { level = "warn", priority = -1 } -nursery = { level = "warn", priority = -1 } -pedantic = { level = "warn", priority = -1 } -perf = { level = "warn", priority = -1 } -style = { level = "warn", priority = -1 } - -# The lint groups above enable some less-than-desirable rules, we should manually -# enable those to keep our sanity. -absolute_paths = "allow" -arbitrary_source_item_ordering = "allow" -implicit_return = "allow" -missing_docs_in_private_items = "allow" -non_ascii_literal = "allow" -pattern_type_mismatch = "allow" -print_stdout = "allow" -question_mark_used = "allow" -similar_names = "allow" -single_call_fn = "allow" -std_instead_of_core = "allow" -too_long_first_doc_paragraph = "allow" -too_many_lines = "allow" -unused_trait_names = "allow" +strip = "none" diff --git a/README.md b/README.md index 8f59640..88d7d39 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,17 @@ - -
Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed
-
[!NOTE]
-> You will need a Nerdfonts patched font installed, and for your terminal
-> emulator to support said font. Microfetch uses nerdfonts glyphs by default,
-> but this can be changed by [patching the program](#customizing).
+Microfetch is packaged in [nixpkgs](https://github.com/nixos/nixpkgs). You can
+get it through the unstable channel for the time being. The Nix flake can also
+be used for bleeding-edge builds.
-Microfetch is packaged in [nixpkgs](https://github.com/nixos/nixpkgs). It can be
-installed by adding `pkgs.microfetch` to your `environment.systemPackages`.
-Additionally, you can try out Microfetch in a Nix shell.
-
-```bash
-nix shell nixpkgs#microfetch
-```
-
-Or run it directly with `nix run`
-
-```bash
-nix run nixpkgs#microfetch
-```
-
-Non-Nix users will have to build Microfetch with `cargo`. It is not published
-anywhere but I imagine you can use `cargo install --git` to install it from
-source.
-
-```bash
-cargo install --git https://github.com/notashelf/microfetch.git
-```
+Non-Nix users will have to build Microfetch with `cargo`.
Microfetch is _currently_ not available anywhere else. Though, does it _really_
have to be?
+## Benchmarks
+
+Microfetch's performance is mostly hardware-dependant, however, the overall
+trend seems to be < 2ms on any modern (2015 and after) CPU. Below are the
+benchmarks with Hyperfine on my desktop system.
+
+| Command | Mean [ms] | Min [ms] | Max [ms] | Relative | Written by raf? |
+| :----------- | ----------: | -------: | -------: | -------------: | --------------: |
+| `microfetch` | 1.3 ± 0.0 | 1.3 | 1.4 | 1.00 | yes |
+| `pfetch` | 254.2 ± 4.8 | 246.7 | 264.9 | 191.97 ± 7.10 | no |
+| `neofetch` | 735.4 ± 9.5 | 721.1 | 752.8 | 555.48 ± 19.08 | no |
+| `fastfetch` | 31.9 ± 0.8 | 30.8 | 33.8 | 24.08 ± 0.98 | no |
+
+_As far as I'm concerned, Microfetch is faster than almost every fetch tool
+there is. The only downside of using Rust is introducing more "bloated"
+dependency trees and increasing build times. The latter is easily mitigated with
+Nix's binary cache, though._
+
## Customizing
-You can't.
+You can't\*.
### Why?
-Customization, of most kinds, are expensive: I could try reading environment
-variables, parse command-line arguments or read a configuration file to allow
-configuring various fields but those inflate execution time and the resource
-consumption by a lot. Since Microfetch is closer to a code golf challenge than a
-program that attempts to fill a gap, I have elected not to make this trade.
+Customization, of any kind, is expensive: I could try reading environment
+variables, parse command-line arguments or read a configuration file but all of
+those increment execution time and resource consumption by a lot.
### Really?
-[main module]: ./src/main.rs
-[discussions tab]: https://github.com/NotAShelf/microfetch/discussions
-
-To be fair, you _can_ customize Microfetch by, well, patching it. It is
-certainly not the easiest way of doing so but if you are planning to change
-something in Microfetch, patching is the best way to go. It will also the only
-way that does not compromise on speed, unless you patch in bad code. Various
-users have adapted Microfetch to their distribution by patching the
-[main module] and inserting the logo of their choice. This is also the best way
-to go if you plan to make small changes. If your changes are not small, you
-might want to look for a program that is designed to be customizable; Microfetch
-is built for maximum performance.
-
-The Nix package allows passing patches in a streamlined manner by passing
-`.overrideAttrs` to the derivation. You can apply your patches in `patches` and
-share your derivations with people. Feel free to use the [discussions tab] to
-share your own variants of Microfetch!
+To be fair, you _can_ customize Microfetch by... Well, patching it. It's not the
+best way per se, but it will be the only way that does not compromise on speed.
## Contributing
@@ -237,45 +92,20 @@ them altogether, as you might have a really good idea worth discussing but as a
general rule of thumb consider talking to me before creating a feature PR.
Contributions that help improve performance in specific areas of Microfetch are
-welcome. Though, prepare to be bombarded with questions if your changes are
-large.
+welcome. Though, prepare to be bombarded with questions.
-### Hacking
+## Hacking
-A Nix flake is provided. You may use `nix develop` to get started. Direnv users
-may instead run `direnv allow` to get a complete environment with shell
-integration.
+A Nix flake is provided. `nix develop` to get started. Direnv users may simply
+run `direnv allow` to get started.
-Non-Nix user will need `cargo`, `clang` and `mold` installed on their system to
-build Microfetch. As Mold seems to yield _slightly_ better results than the
-default linker, it has been set as the default in `.cargo/config.toml` for
-x86-64 Linux. You may override those defaults using the `RUSTFLAGS` environment
-variable. For example:
-
-```sh
-# Use ld instead of Mold
-$ RUSTFLAGS="-C linker=/path/to/ld.lld" cargo build
-```
+Non-nix users will need `cargo` and `gcc` installed on their system, see
+`Cargo.toml` for available release profiles.
## Thanks
Huge thanks to everyone who took the time to make pull requests or nag me in
-person about current issues. To list a few, special thanks to:
-
-- [@Nydragon](https://github.com/Nydragon) - For packaging Microfetch in Nixpkgs
-- [@ErrorNoInternet](https://github.com/ErrorNoInternet) - Performance
- improvements and code assistance
-- [@SoraTenshi](https://github.com/SoraTenshi) - General tips and code
- improvements
-- [@bloxx12](https://github.com/bloxx12) - Performance improvements and
- benchmarking plots
-- [@sioodmy](https://github.com/sioodmy) - Being cute
-- [@mewoocat](https://github.com/mewoocat) - The awesome NixOS logo ASCII used
- in Microfetch
-- [@uzaaft](https://github.com/uzaaft) - Helping me going faster
-
-Additionally a big thank you to everyone who used, talked about or criticized
-Microfetch. I might have missed your name here, but you have my thanks.
+person about current issues.
## License
diff --git a/benches/benchmark.rs b/benches/benchmark.rs
deleted file mode 100644
index 8d62082..0000000
--- a/benches/benchmark.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use criterion::{Criterion, criterion_group, criterion_main};
-use microfetch_lib::{
- UtsName,
- colors::print_dots,
- desktop::get_desktop_info,
- release::{get_os_pretty_name, get_system_info},
- system::{
- get_memory_usage,
- get_root_disk_usage,
- get_shell,
- get_username_and_hostname,
- },
- uptime::get_current,
-};
-
-fn main_benchmark(c: &mut Criterion) {
- let utsname = UtsName::uname().expect("Failed to get uname");
- c.bench_function("user_info", |b| {
- b.iter(|| get_username_and_hostname(&utsname));
- });
- c.bench_function("os_name", |b| b.iter(get_os_pretty_name));
- c.bench_function("kernel_version", |b| b.iter(|| get_system_info(&utsname)));
- c.bench_function("shell", |b| b.iter(get_shell));
-
- c.bench_function("desktop", |b| b.iter(get_desktop_info));
- c.bench_function("uptime", |b| b.iter(get_current));
- c.bench_function("memory_usage", |b| b.iter(get_memory_usage));
- c.bench_function("storage", |b| b.iter(get_root_disk_usage));
- c.bench_function("colors", |b| b.iter(print_dots));
-}
-
-criterion_group!(benches, main_benchmark);
-criterion_main!(benches);
diff --git a/flake.lock b/flake.lock
index 452a532..77bd438 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,19 +2,15 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1743359643,
- "narHash": "sha256-RkyJ9a67s0zEIz4O66TyZOIGh4TFZ4dKHKMgnxZCh2I=",
- "lastModified": 1763381801,
- "narHash": "sha256-325fR0JmHW7B74/gHPv/S9w1Rfj/M2HniwQFUwdrZ9k=",
+ "lastModified": 1722719969,
+ "narHash": "sha256-E47qbT/mRtBCSZra+9S9208sp/QnNeOAq7EhHX+eMNE=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "ca77b4bc80e558ce59f2712fdb276f90c0ee309a",
- "rev": "46931757ea8bdbba25c076697f8e73b8dc39fef5",
+ "rev": "83a364ced9d5b8a6bdac897bbef6b91e70777b97",
"type": "github"
},
"original": {
"owner": "NixOS",
- "ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
diff --git a/flake.nix b/flake.nix
index 90978a2..b5035c3 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,6 +1,6 @@
{
description = "A microscopic fetch script in Rust, for NixOS systems";
- inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = {
self,
@@ -10,12 +10,8 @@
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in {
- packages = forEachSystem (system: let
- pkgs = pkgsForEach.${system};
- in {
- default = self.packages.${system}.microfetch;
- microfetch = pkgs.callPackage ./nix/package.nix {};
- microfetch-mold = pkgs.callPackage ./nix/package.nix {useMold = true;};
+ packages = forEachSystem (system: {
+ default = pkgsForEach.${system}.callPackage ./nix/package.nix {};
});
devShells = forEachSystem (system: {
diff --git a/nix/package.nix b/nix/package.nix
index 052f576..1a7dde3 100644
--- a/nix/package.nix
+++ b/nix/package.nix
@@ -1,53 +1,30 @@
{
lib,
- stdenv,
- stdenvAdapters,
rustPlatform,
+ stdenvAdapters,
llvm,
- useMold ? stdenv.isLinux && !stdenv.hostPlatform.isAarch,
}: let
toml = (lib.importTOML ../Cargo.toml).package;
pname = toml.name;
inherit (toml) version;
-
- # Select stdenv based on useMold flag
- stdenv =
- if useMold
- then stdenvAdapters.useMoldLinker llvm.stdenv
- else llvm.stdenv;
in
- rustPlatform.buildRustPackage.override {inherit stdenv;} {
+ rustPlatform.buildRustPackage.override {stdenv = stdenvAdapters.useMoldLinker llvm.stdenv;} {
+ RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
+
inherit pname version;
- src = let
- fs = lib.fileset;
- s = ../.;
- in
- fs.toSource {
- root = s;
- fileset = fs.unions [
- (fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
- (s + /Cargo.lock)
- (s + /Cargo.toml)
- (s + /benches)
- ];
- };
- cargoLock.lockFile = ../Cargo.lock;
- enableParallelBuilding = true;
- buildNoDefaultFeatures = true;
- doCheck = false;
-
- # Only set RUSTFLAGS for mold if useMold is enabled
- env = lib.optionalAttrs useMold {
- CARGO_LINKER = "clang";
- RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
+ src = builtins.path {
+ name = "${pname}-${version}";
+ path = lib.sources.cleanSource ../.;
};
+ cargoLock.lockFile = ../Cargo.lock;
+
meta = {
- description = "Microscopic fetch script in Rust, for NixOS systems";
+ description = "A microscopic fetch script in Rust, for NixOS systems";
homepage = "https://github.com/NotAShelf/microfetch";
license = lib.licenses.gpl3Only;
- maintainers = [lib.maintainers.NotAShelf];
+ maintainers = with lib.maintainers; [NotAShelf];
mainProgram = "microfetch";
};
}
diff --git a/nix/shell.nix b/nix/shell.nix
index ae65e10..5efe65c 100644
--- a/nix/shell.nix
+++ b/nix/shell.nix
@@ -1,31 +1,24 @@
{
mkShell,
- cargo,
- rustc,
- mold,
- clang,
rust-analyzer-unwrapped,
rustfmt,
clippy,
- taplo,
+ cargo,
+ rustc,
+ gcc,
rustPlatform,
- gnuplot,
}:
mkShell {
- name = "microfetch";
strictDeps = true;
+
nativeBuildInputs = [
cargo
rustc
- mold
- clang
+ gcc
rust-analyzer-unwrapped
- (rustfmt.override {asNightly = true;})
+ rustfmt
clippy
- taplo
-
- gnuplot # for Criterion.rs plots
];
env.RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
diff --git a/src/colors.rs b/src/colors.rs
index 7c65944..a8aee60 100644
--- a/src/colors.rs
+++ b/src/colors.rs
@@ -1,81 +1,11 @@
-use std::sync::LazyLock;
+pub const RESET: &str = "\x1b[0m";
+pub const BLUE: &str = "\x1b[34m";
+pub const CYAN: &str = "\x1b[36m";
+pub const GREEN: &str = "\x1b[32m";
+pub const YELLOW: &str = "\x1b[33m";
+pub const RED: &str = "\x1b[31m";
+pub const MAGENTA: &str = "\x1b[35m";
-pub struct Colors {
- pub reset: &'static str,
- pub blue: &'static str,
- pub cyan: &'static str,
- pub green: &'static str,
- pub yellow: &'static str,
- pub red: &'static str,
- pub magenta: &'static str,
-}
-
-impl Colors {
- const fn new(is_no_color: bool) -> Self {
- if is_no_color {
- Self {
- reset: "",
- blue: "",
- cyan: "",
- green: "",
- yellow: "",
- red: "",
- magenta: "",
- }
- } else {
- Self {
- reset: "\x1b[0m",
- blue: "\x1b[34m",
- cyan: "\x1b[36m",
- green: "\x1b[32m",
- yellow: "\x1b[33m",
- red: "\x1b[31m",
- magenta: "\x1b[35m",
- }
- }
- }
-}
-
-pub static COLORS: LazyLock