diff options
| author | bors <bors@rust-lang.org> | 2019-05-13 00:28:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-13 00:28:38 +0000 |
| commit | fe5f42cdb88d8ce31f746130099321e7c95e1ef0 (patch) | |
| tree | d895b0ba0c1aca391e69c34a3b96b3eba48d9dd2 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 4443957f272e304e083a8d98583e608d65a712aa (diff) | |
| parent | ea9fac5687c24abad493caf4ec5042af47458af9 (diff) | |
| download | rust-fe5f42cdb88d8ce31f746130099321e7c95e1ef0.tar.gz rust-fe5f42cdb88d8ce31f746130099321e7c95e1ef0.zip | |
Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkov
Use `Symbol` more A `Symbol` can be equated with a string (e.g. `&str`). This involves a TLS lookup to get the chars (and a Mutex lock in a parallel compiler) and then a char-by-char comparison. This functionality is convenient but avoids one of the main benefits of `Symbol`s, which is fast equality comparisons. This PR removes the `Symbol`/string equality operations, forcing a lot of existing string occurrences to become `Symbol`s. Fortunately, these are almost all static strings (many are attribute names) and we can add static `Symbol`s as necessary, and very little extra interning occurs. The benefits are (a) a slight speedup (possibly greater in a parallel compiler), and (b) the code is a lot more principled about `Symbol` use. The main downside is verbosity, particularly with more `use syntax::symbol::symbols` items. r? @Zoxc
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
