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

Avoid symbol interning in file_metadata. #60973

Merged
merged 1 commit into from
May 22, 2019

Conversation

nnethercote
Copy link
Contributor

This commit changes created_files so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses entry to avoid doing a repeated hash table lookup
(get + insert).

Note that PR #60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2019
@nnethercote
Copy link
Contributor Author

@bors try

@bors
Copy link
Contributor

bors commented May 20, 2019

⌛ Trying commit c5d9401 with merge e11f8591b0bf303236feec74e4b2de46f82db752...

@davidtwco
Copy link
Member

LGTM, but I'm not able to approve PRs.

r? @michaelwoerister

@nnethercote
Copy link
Contributor Author

@davidtwco: Has your status changed recently? You approved #60467, which was related.

@davidtwco
Copy link
Member

@davidtwco: Has your status changed recently?

It has. Can chat on Zulip if you want to know more.

@bors
Copy link
Contributor

bors commented May 20, 2019

☀️ Try build successful - checks-travis
Build commit: e11f8591b0bf303236feec74e4b2de46f82db752

@michaelwoerister
Copy link
Member

@rust-timer build e11f8591b0bf303236feec74e4b2de46f82db752

@rust-timer
Copy link
Collaborator

Success: Queued e11f8591b0bf303236feec74e4b2de46f82db752 with parent caef1e8, comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit e11f8591b0bf303236feec74e4b2de46f82db752: comparison url

@nnethercote
Copy link
Contributor Author

The perf results are weak. The new code is arguably cleaner, reducing the number of arguments. @michaelwoerister, I'll let you decide if it's worth taking.

@michaelwoerister
Copy link
Member

Yes, the new code is cleaner. Thanks, @nnethercote!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 21, 2019

📌 Commit c5d9401 has been approved by michaelwoerister

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 21, 2019
@bors
Copy link
Contributor

bors commented May 21, 2019

⌛ Testing commit c5d9401 with merge b02dc3ce95855e249764e18415a05555ae4202c5...

@pietroalbini
Copy link
Member

pietroalbini commented May 21, 2019

@bors retry

Yielding priority to the beta release.

@rust-highfive
Copy link
Collaborator

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Cloning into 'rust-lang/rust'...
travis_time:end:275de31f:start=1558439731837882177,finish=1558439737701575122,duration=5863692945
$ cd rust-lang/rust
$ git checkout -qf b02dc3ce95855e249764e18415a05555ae4202c5
fatal: reference is not a tree: b02dc3ce95855e249764e18415a05555ae4202c5
The command "git checkout -qf b02dc3ce95855e249764e18415a05555ae4202c5" failed and exited with 128 during .
Your build has been stopped.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@nnethercote
Copy link
Contributor Author

@bors retry

Centril added a commit to Centril/rust that referenced this pull request May 21, 2019
… r=michaelwoerister

Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
Centril added a commit to Centril/rust that referenced this pull request May 21, 2019
… r=michaelwoerister

Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
Centril added a commit to Centril/rust that referenced this pull request May 21, 2019
… r=michaelwoerister

Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
Centril added a commit to Centril/rust that referenced this pull request May 22, 2019
… r=michaelwoerister

Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
bors added a commit that referenced this pull request May 22, 2019
Rollup of 10 pull requests

Successful merges:

 - #59742 (Move `edition` outside the hygiene lock and avoid accessing it)
 - #60581 (convert custom try macro to `?`)
 - #60963 (Update boxed::Box docs on memory layout)
 - #60973 (Avoid symbol interning in `file_metadata`.)
 - #60982 (Do not fail on child without DefId)
 - #60991 (LocalDecl push returns Local len)
 - #60995 (Add stream_to_parser_with_base_dir)
 - #60998 (static_assert: make use of anonymous constants)
 - #61003 (Remove impls for `InternedString`/string equality.)
 - #61006 (adjust deprecation date of mem::uninitialized)

Failed merges:

r? @ghost
@bors bors merged commit c5d9401 into rust-lang:master May 22, 2019
@nnethercote nnethercote deleted the fix-file_metadata-more branch May 22, 2019 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants