about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
AgeCommit message (Collapse)AuthorLines
2023-09-06Extract parallel operations in `rustc_data_structures::sync` into a new ↵John Kåre Alsaker-171/+193
`parallel` submodule
2023-09-02Rename `Freeze` to `FreezeLock`John Kåre Alsaker-8/+8
2023-09-02Add some commentsJohn Kåre Alsaker-1/+4
2023-09-02Use `RwLock` for `Freeze`John Kåre Alsaker-8/+10
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-0/+107
2023-09-01Use `OnceLock` for `SingleCache`John Kåre Alsaker-2/+2
2023-08-30Use a `parallel_guard` function to handle the parallel guardJohn Kåre Alsaker-60/+55
2023-08-30Use `Mutex` to avoid issue with conditional locksJohn Kåre Alsaker-4/+3
2023-08-30Add `ParallelGuard` type to handle unwinding in parallel sectionsJohn Kåre Alsaker-121/+68
2023-08-30Make parallel! an expressionJohn Kåre Alsaker-2/+2
2023-08-30Use conditional synchronization for LockJohn Kåre Alsaker-91/+298
2023-08-29Auto merge of #114894 - Zoxc:sharded-cfg-cleanup2, r=cjgillotbors-7/+18
Remove conditional use of `Sharded` from query state `Sharded` is already a zero cost abstraction, so it shouldn't affect the performance of the single thread compiler if LLVM does its job. r? `@cjgillot`
2023-08-28don't use SnapshotVec in Graph implementation, as it looks unused; use Vec ↵klensy-19/+4
instead
2023-08-24Rollup merge of #114987 - RalfJung:unsound-mmap, r=cjgillotWeihang Lo-1/+6
elaborate a bit on the (lack of) safety in 'Mmap::map' Sadly none of the callers of this function even consider it worth mentioning in their unsafe block that what they are doing is completely unsound.
2023-08-24Optimize `lock_shards`John Kåre Alsaker-7/+18
2023-08-24Auto merge of #115082 - Zoxc:syntax-context-decode-race, r=cjgillotbors-0/+6
Fix races conditions with `SyntaxContext` decoding This changes `SyntaxContext` decoding to work with concurrent decoding. The `remapped_ctxts` field now only stores `SyntaxContext` which have completed decoding, while the new `decoding` and `local_in_progress` keeps track of `SyntaxContext`s which are in process of being decoding and on which threads. This fixes 2 issues with the current implementation. It can return an `SyntaxContext` which contains dummy data if another thread starts decoding before the first one has completely finished. Multiple threads could also allocate multiple `SyntaxContext`s for the same `raw_id`.
2023-08-24Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonurbors-1/+1
Update bootstrap compiler to 1.73.0 beta
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1
2023-08-22Fix races conditions with `SyntaxContext` decodingJohn Kåre Alsaker-0/+6
2023-08-19elaborate a bit on the (lack of) safety in 'Mmap::map'Ralf Jung-1/+6
2023-08-16Remove `count`John Kåre Alsaker-10/+9
2023-08-16Keep SHARDS fixed instead of a function of `cfg!(parallel_compiler)`John Kåre Alsaker-4/+19
2023-08-15Make Sharded an enum and specialize it for the single thread caseJohn Kåre Alsaker-36/+30
2023-08-08Auto merge of #114339 - ttsugriy:unsafe-utf8, r=davidtwcobors-1/+4
[rustc_data_structures][base_n][perf] Remove unnecessary utf8 check. Since all output characters taken from `BASE_64` are valid UTF8 chars there is no need to waste cycles on validation. Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3) on M1 MacBook Air with following results: ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.670 µs 14.852 µs 15.074 µs] Found 11 outliers among 100 measurements (11.00%) 4 (4.00%) high mild 7 (7.00%) high severe push_str/new time: [12.573 µs 12.674 µs 12.801 µs] Found 11 outliers among 100 measurements (11.00%) 7 (7.00%) high mild 4 (4.00%) high severe ```
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-08-01[rustc_data_structures][base_n][perf] Remove unnecessary utf8 check.Taras Tsugrii-1/+4
Since all output characters taken from `BASE_64` are valid UTF8 chars there is no need to waste cycles on validation. Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3) on M1 MacBook Air with following results: ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.670 µs 14.852 µs 15.074 µs] Performance has regressed. Found 11 outliers among 100 measurements (11.00%) 4 (4.00%) high mild 7 (7.00%) high severe push_str/new time: [12.573 µs 12.674 µs 12.801 µs] Performance has regressed. Found 11 outliers among 100 measurements (11.00%) 7 (7.00%) high mild 4 (4.00%) high severe ```
2023-08-01Rollup merge of #114306 - ttsugriy:push_str, r=wesleywiserMatthias Krüger-4/+3
[rustc_data_structures][perf] Simplify base_n::push_str. This minor change removes the need to reverse resulting digits. Since reverse is O(|digit_num|) but bounded by 128, it's unlikely to be a noticeable in practice. At the same time, this code is also a 1 line shorter, so combined with tiny perf win, why not? I ran https://gist.github.com/ttsugriy/ed14860ef597ab315d4129d5f8adb191 on M1 macbook air and got a small improvement ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.180 µs 14.313 µs 14.462 µs] Performance has improved. Found 5 outliers among 100 measurements (5.00%) 4 (4.00%) high mild 1 (1.00%) high severe push_str/new time: [13.741 µs 13.839 µs 13.973 µs] Performance has improved. Found 8 outliers among 100 measurements (8.00%) 3 (3.00%) high mild 5 (5.00%) high severe ```
2023-08-01Rollup merge of #114283 - oli-obk:parkin_lot_rwlock, r=SparrowLiiMatthias Krüger-21/+7
Use parking lot's rwlock even without parallel-rustc Considering that this doesn't affect perf, I think we should use the simplest solution.
2023-08-01Always use parking_lot's RwLock, even without parallel compilerOli Scherer-21/+7
2023-08-01Rollup merge of #114313 - ttsugriy:sm-insert, r=petrochenkovMatthias Krüger-3/+2
[rustc_data_structures] Simplify SortedMap::insert. It looks like current usage of `swap` is aimed at achieving what `std::mem::replace` does but more concisely and idiomatically.
2023-07-31[rustc_data_structures] Simplify SortedMap::insert.Taras Tsugrii-3/+2
It looks like current usage of `swap` is aimed at achieving what `std::mem::replace` does but more concisely and idiomatically.
2023-07-31Rollup merge of #113717 - cuishuang:master, r=NilstriebMatthias Krüger-1/+1
remove repetitive words
2023-07-31[rustc_data_structures][perf] Simplify base_n::push_str.Taras Tsugrii-4/+3
This minor change removes the need to reverse resulting digits. Since reverse is O(|digit_num|) but bounded by 128, it's unlikely to be a noticeable in practice. At the same time, this code is also a 1 line shorter, so combined with tiny perf win, why not? I ran https://gist.github.com/ttsugriy/ed14860ef597ab315d4129d5f8adb191 on M1 macbook air and got a small improvement ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.180 µs 14.313 µs 14.462 µs] Performance has improved. Found 5 outliers among 100 measurements (5.00%) 4 (4.00%) high mild 1 (1.00%) high severe push_str/new time: [13.741 µs 13.839 µs 13.973 µs] Performance has improved. Found 8 outliers among 100 measurements (8.00%) 3 (3.00%) high mild 5 (5.00%) high severe ```
2023-07-31remove repetitive wordscui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-07-29[rustc_data_structures] Use partition_point to find binary_search_slice end.Taras Tsugrii-21/+8
2023-07-29[rustc][data_structures] Simplify binary_search_slice.Taras Tsugrii-31/+7
2023-07-23more clippy::style fixes:Matthias Krüger-5/+1
get_first single_char_add_str unnecessary_mut_passed manual_map manual_is_ascii_check
2023-07-14Introduce ExtentUnord trait for collections that can safely consume UnordItems.Michael Woerister-20/+32
2023-07-14Enable potential_query_instability lint in rustc_hir_typeck.Michael Woerister-2/+19
Fix linting errors by using FxIndex(Map|Set) and Unord(Map|Set) as appropriate.
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+1
2023-06-29Remove `SmallStr`.Nicholas Nethercote-89/+0
It no longer has any uses. If it's needed in the future, it can be easily reinstated. Or a crate such as `smallstr` can be used, much like we use `smallvec`.
2023-06-21Rollup merge of #112538 - ndrewxie:issue-84447-partial-1, r=compiler-errorsGuillaume Gomez-4/+4
Removed unnecessary &String -> &str, now that &String implements StableOrd as well Applied a few nits suggested by lcnr to PR #110040 (nits can be found [here](https://github.com/rust-lang/rust/pull/110040#pullrequestreview-1469452191).) Making a new PR because the old one was already merged, and given that this just applies changes that were already suggested, reviewing it should be fairly open-and-shut.
2023-06-19Make closure_saved_names_of_captured_variables a query.Camille GILLOT-1/+13
2023-06-11Applied nitsAndrew Xie-4/+4
2023-06-09Don't print Interned or PrivateZstMichael Goulet-1/+7
2023-06-08Removed stable/unstable sort arg from into_sorted_stable_ord, fixed a few ↵Andrew Xie-10/+43
misc issues, added collect to UnordItems
2023-06-05Fixed to_sorted => to_sorted_stable_ordAndrew Xie-0/+11
2023-06-04Fixed unord mistakeAndrew Xie-5/+0
2023-06-04Fixed failing test + minor cleanupAndrew Xie-0/+5
2023-06-02Update dependencies with reported vulnerabilitiesArlo Siemsen-1/+1
bumpalo 3.12.1 (yanked) * updated to 3.13.0 tokio 1.8.4 - https://rustsec.org/advisories/RUSTSEC-2023-0001 * updated to 1.28.2 remove_dir_all 0.5.3 - https://rustsec.org/advisories/RUSTSEC-2023-0018 * removed by using the standard library function in `rust-installer` instead and updating to `tempfile@3.5.0` (which also removes the dependency).