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

[DO NOT MERGE] Try indexmap with its own RawTable #129965

Closed
wants to merge 1 commit into from

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Sep 4, 2024

I want to see whether there's any noticeable performance difference in rustc if indexmap embeds its own copy of hashbrown::raw::RawTable<usize>, specialized for its own use. The generic parameters are removed, as well as a lot of unused code, and some of the raw API is further tweaked for dealing with always-copyable usize data.

r? ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 4, 2024
@cuviper
Copy link
Member Author

cuviper commented Sep 4, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 4, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 4, 2024
[DO NOT MERGE] Try `indexmap` with its own `RawTable`

I want to see whether there's any noticeable performance difference in `rustc` if `indexmap` embeds its own copy of `hashbrown::raw::RawTable<usize>`, specialized for its own use. The generic parameters are removed, as well as a lot of unused code, and some of the raw API is further tweaked for dealing with always-copyable `usize` data.

* Full `indexmap` comparison: indexmap-rs/indexmap@master...cuviper:raw
* Changes after the initial import: indexmap-rs/indexmap@cfb8d04...cuviper:raw

r? ghost
@bors
Copy link
Contributor

bors commented Sep 4, 2024

⌛ Trying commit adce254 with merge d3ed2e8...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check-tidy failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

# NOTE: intentionally uses python2 for x.py so we can test it still works.
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
ENV SCRIPT TIDY_PRINT_DIFF=1 python2.7 ../x.py test \
           --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    pip-compile --allow-unsafe --generate-hashes reuse-requirements.in
---
#13 2.806 Building wheels for collected packages: reuse
#13 2.807   Building wheel for reuse (pyproject.toml): started
#13 3.052   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 3.053   Created wheel for reuse: filename=reuse-4.0.3-cp310-cp310-manylinux_2_35_x86_64.whl size=132715 sha256=dfa09868353292d98f811d3efdb0d54d07389e808efc71d68e3b93c514bf8bec
#13 3.053   Stored in directory: /tmp/pip-ephem-wheel-cache-kpubk7_e/wheels/3d/8d/0a/e0fc6aba4494b28a967ab5eaf951c121d9c677958714e34532
#13 3.056 Installing collected packages: boolean-py, binaryornot, tomlkit, reuse, python-debian, markupsafe, license-expression, jinja2, chardet, attrs
#13 3.440 Successfully installed attrs-23.2.0 binaryornot-0.4.4 boolean-py-4.0 chardet-5.2.0 jinja2-3.1.4 license-expression-30.3.0 markupsafe-2.1.5 python-debian-0.1.49 reuse-4.0.3 tomlkit-0.13.0
#13 3.441 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
#13 3.955 Collecting virtualenv
#13 3.955 Collecting virtualenv
#13 3.992   Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
#13 4.068      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 76.2 MB/s eta 0:00:00
#13 4.125 Collecting filelock<4,>=3.12.2
#13 4.128   Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
#13 4.145 Collecting distlib<1,>=0.3.7
#13 4.148   Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
#13 4.155      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 468.9/468.9 KB 92.4 MB/s eta 0:00:00
#13 4.183 Collecting platformdirs<5,>=3.9.1
#13 4.189   Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
#13 4.270 Installing collected packages: distlib, platformdirs, filelock, virtualenv
#13 4.455 Successfully installed distlib-0.3.8 filelock-3.15.4 platformdirs-4.2.2 virtualenv-20.26.3
#13 DONE 4.5s

#14 [7/8] COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
#14 DONE 0.0s
---
DirectMap4k:      229312 kB
DirectMap2M:    11304960 kB
DirectMap1G:     7340032 kB
##[endgroup]
Executing TIDY_PRINT_DIFF=1 python2.7 ../x.py test            --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
+ TIDY_PRINT_DIFF=1 python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest --extra-checks=py:lint,cpp:fmt
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/842d6fc32e3d0d26bb11fbe6a2f6ae2afccc06cb/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz
extracting /checkout/obj/build/cache/llvm-842d6fc32e3d0d26bb11fbe6a2f6ae2afccc06cb-true/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.xz to /checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm
---
##[endgroup]
fmt check
fmt: checked 5525 files
tidy check
tidy error: invalid source: "git+https://github.com/cuviper/indexmap?branch=raw#4db206673c970d65e35cecebf9d26acd85b15a30"
removing old virtual environment
removing old virtual environment
creating virtual environment at '/checkout/obj/build/venv' using 'python3.10'
Requirement already satisfied: pip in ./build/venv/lib/python3.10/site-packages (24.1)
  Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 6.1 MB/s eta 0:00:00
Installing collected packages: pip
---
Successfully installed pip-24.2
linting python files
All checks passed!
checking C++ file formatting
some tidy checks failed
Command has failed. Rerun with -v to see more details.
  local time: Wed Sep  4 17:38:42 UTC 2024
  network time: Wed, 04 Sep 2024 17:38:42 GMT
##[error]Process completed with exit code 1.
Post job cleanup.

@bors
Copy link
Contributor

bors commented Sep 4, 2024

☀️ Try build successful - checks-actions
Build commit: d3ed2e8 (d3ed2e85fb6fb06dd428115ec043dac22697dbb1)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d3ed2e8): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.6% [-4.6%, -4.6%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -2.7%, secondary -0.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
-3.2% [-3.8%, -2.6%] 2
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Cycles

Results (secondary -4.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.4% [-4.4%, -4.4%] 1
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Bootstrap: 751.345s -> 750.983s (-0.05%)
Artifact size: 340.69 MiB -> 340.68 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 4, 2024
@cuviper
Copy link
Member Author

cuviper commented Sep 4, 2024

Huh, that is kind of surprising that it came back so neutral. Expanding "non-relevant results" looks like it did maybe make a slight gain overall, but nothing to write home about. It doesn't seem to justify the effort to maintain a separate RawTable in the long run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants