Skip to content

[DO NOT MERGE] Remove InternedString #65543

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 5 commits into from

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Oct 18, 2019

This is a proof of concept relating to #60869. It does the following:

  • Makes Symbol equivalent to InternedString, primarily by Changing Symbol's PartialOrd, Ord, and Hash impls to work on the chars instead of the index.
  • Removes InternedString.

It shows that this approach works, but causes some performance regressions.

r? @ghost

Instead of `as_str()`, which unnecessarily involves `LocalInternedString`.
Currently, `Symbol::Debug` and `Symbol::Display` produce the same
output; neither wraps the symbol in double quotes.

This commit changes `Symbol::Debug` so it wraps the symbol in quotes.
This change brings `Symbol`'s behaviour in line with `String` and
`InternedString`. The change requires a couple of trivial test output
adjustments.
Because it's now entirely equivalent to `Symbol`.
`Clone` and `Copy` haven't been needed for some time.

`Eq`, `PartialOrd`, `Ord` are no longer necessary now that `Symbol` is
ordered by chars rather than index.
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Collaborator

bors commented Oct 18, 2019

⌛ Trying commit f0648cb with merge 0533837...

bors added a commit that referenced this pull request Oct 18, 2019
[DO NOT MERGE] Remove `InternedString`

This is a proof of concept relating to #60869. It does the following:
- Makes `Symbol` equivalent to `InternedString`, primarily by Changing `Symbol`'s `PartialOrd`, `Ord`, and `Hash` impls to work on the chars instead of the index.
- Removes `InternedString`.

It shows that this approach works, but causes some performance regressions.

r? @ghost
@bors
Copy link
Collaborator

bors commented Oct 18, 2019

☀️ Try build successful - checks-azure
Build commit: 0533837 (053383782dbe74957ba7ffee3dc80c4162a33f8a)

@rust-timer
Copy link
Collaborator

Queued 0533837 with parent fa0f7d0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 0533837, comparison URL.

@nnethercote
Copy link
Contributor Author

As expected, lots of perf regressions, up to 3.5%.

@mati865
Copy link
Member

mati865 commented Oct 19, 2019

Wall time doesn't look bad though.

@nnethercote
Copy link
Contributor Author

#65657 ended up removing InternedString in a better way.

@nnethercote nnethercote deleted the rm-InternedString branch April 2, 2020 03:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants