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 repeated interning of static strings. #60467

Merged
merged 1 commit into from May 3, 2019

Conversation

@nnethercote
Copy link
Contributor

@nnethercote nnethercote commented May 2, 2019

file_metadata_raw interns the strings "<unknown>" and "" very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.

@rust-highfive
Copy link
Collaborator

@rust-highfive rust-highfive commented May 2, 2019

r? @davidtwco

(rust_highfive has picked a reviewer for you, use r? to override)

`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
@nnethercote nnethercote force-pushed the nnethercote:less-symbol-interning branch from 4a55734 to 6ef39e6 May 2, 2019
@davidtwco
Copy link
Member

@davidtwco davidtwco commented May 2, 2019

@bors r+ rollup

@bors
Copy link
Contributor

@bors bors commented May 2, 2019

📌 Commit 6ef39e6 has been approved by davidtwco

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

Avoid repeated interning of static strings.

`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
bors added a commit that referenced this pull request May 3, 2019
Rollup of 11 pull requests

Successful merges:

 - #59928 (Make deprecation lint `ambiguous_associated_items` deny-by-default)
 - #60135 (Added arm-none-eabi target)
 - #60220 (report fatal errors during doctest parsing)
 - #60373 (Tidy: ensure lang features are sorted by since)
 - #60393 ( Do not suggest incorrect syntax on pattern type error due to borrow)
 - #60401 (Rename `RUST_LOG` to `RUSTC_LOG`)
 - #60409 (Require a trait in the bounds of existential types)
 - #60449 (Constrain all regions in the concrete type for an opaque type)
 - #60455 (Resolve match arm ty when arms diverge)
 - #60457 (Const prop refactoring)
 - #60467 (Avoid repeated interning of static strings.)

Failed merges:

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

Avoid repeated interning of static strings.

`file_metadata_raw` interns the strings `"<unknown>"` and `""` very
frequently. This commit avoids that, which reduces the number of symbols
interned significantly and reduces instruction counts by up to 0.5% on
some workloads.
bors added a commit that referenced this pull request May 3, 2019
Rollup of 12 pull requests

Successful merges:

 - #59928 (Make deprecation lint `ambiguous_associated_items` deny-by-default)
 - #60220 (report fatal errors during doctest parsing)
 - #60373 (Tidy: ensure lang features are sorted by since)
 - #60388 (Disallow non-explicit elided lifetimes in async fn)
 - #60393 ( Do not suggest incorrect syntax on pattern type error due to borrow)
 - #60401 (Rename `RUST_LOG` to `RUSTC_LOG`)
 - #60409 (Require a trait in the bounds of existential types)
 - #60455 (Resolve match arm ty when arms diverge)
 - #60457 (Const prop refactoring)
 - #60467 (Avoid repeated interning of static strings.)
 - #60478 (minor compiler doc tweaks)
 - #60501 (Propagate mutability from arguments to local bindings in async fn)

Failed merges:

r? @ghost
@bors bors merged commit 6ef39e6 into rust-lang:master May 3, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@nnethercote nnethercote deleted the nnethercote:less-symbol-interning branch May 6, 2019
nnethercote added a commit to nnethercote/rust that referenced this pull request May 20, 2019
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.
bors added a commit that referenced this pull request May 20, 2019
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 #60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
bors added a commit that referenced this pull request May 21, 2019
…oerister

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 #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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.