Uh oh!
There was an error while loading. Please reload this page.
Simplify HashMap layout calculation by using Layout - #51163
Conversation
gnzlbg
commented
May 29, 2018
LGTM! |
SimonSapin
commented
May 29, 2018
@bors r+ |
bors
commented
May 29, 2018
📌 Commit 0fde52b has been approved by |
bors
commented
May 30, 2018
☔ The latest upstream changes (presumably #50880) made this pull request unmergeable. Please resolve the merge conflicts. |
Amanieu
commented
May 31, 2018
Rebased. |
SimonSapin
commented
May 31, 2018
@bors r+ |
bors
commented
May 31, 2018
📌 Commit 01ba7cb has been approved by |
bors
commented
Jun 1, 2018
🔒 Merge conflict |
Amanieu
commented
Jun 1, 2018
Rebased again. @SimonSapin I think this may conflict with your stabilization PR since I added |
SimonSapin
commented
Jun 1, 2018
@Amanieu I don’t mind the conflict, I’ll deal with it in the other PR. But that impl might be notable with respect to stability. If |
SimonSapin
commented
Jun 1, 2018
@bors r+ |
bors
commented
Jun 1, 2018
📌 Commit c6bebf4 has been approved by |
bors
commented
Jun 1, 2018
Simplify HashMap layout calculation by using Layout `RawTable` uses a single allocation to hold both the array of hashes and the array of key/value pairs. This PR changes `RawTable` to use `Layout` when calculating the amount of memory to allocate instead of performing the calculation manually. r? @SimonSapin
bors
commented
Jun 1, 2018
☀️ Test successful - status-appveyor, status-travis |
noticed that this PR have a lot of big red numbers in the perf run maybe there is something that can be improved? |
Hmm, that's worrying. I can think of three ways to improve performance:
|
gnzlbg
commented
Jun 2, 2018
via email
Amanieu my NonZeroUsize PR marks them as inline but I did not see many
obvious perf improvements there. Maybe you could take a look there? …On Sat 2. Jun 2018 at 13:07, Amanieu ***@***.***> wrote:
Hmm, that's worrying. I can think of two ways to improve performance:
- A lot of the Layout methods aren't implemented very efficiently,
they could be improved.
- A lot of the Layout methods aren't marked as #[inline], which hurts
us when the inputs are compile-time constants (size_of, align_of).
- We could cache the pointer to the (K, V) array in the RawTable
rather than recalculating it every time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51163 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA3Nplh0ZoNrzIIJB4klIEx9nYS2zGeBks5t4nHVgaJpZM4URTRe>
.
|
Amanieu
commented
Jun 2, 2018
I think the main issue here is that I made some changes in a branch but I think that it would be easier if you just added those changes to your PR to avoid conflicts. |
gnzlbg
commented
Jun 2, 2018
nnethercote
commented
Jun 4, 2018
I found this independently today and worked back to this PR. There was a subsequent improvement here: which points to these changes: But the improvement wasn't enough to get back all the perf that was lost. Can this PR be backed out? I'd say it has undone roughly 1/3 to 1/2 of the significant rustc perf improvement that had occurred in past few weeks, which is highly discouraging. |
nnethercote
commented
Jun 4, 2018
Here is a Cachegrind diff comparing a rustc from May 27 against one from Jun 04. The numbers are instruction counts: It's mostly additional hash table operations, perhaps involving |
Optimize layout calculations in HashMap This now produces the same assembly code as the previous implementation. cc #51163@nnethercote@gnzlbg@andjo403
RawTableuses a single allocation to hold both the array of hashes and the array of key/value pairs. This PR changesRawTableto useLayoutwhen calculating the amount of memory to allocate instead of performing the calculation manually.r? @SimonSapin