Commit Graph

43 Commits

Author SHA1 Message Date
Caio 6379013876 Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
John Kåre Alsaker 2c507cae36 Rename cold_path to outline 2023-09-25 22:54:07 +02:00
klensy 3c03cce341 bump windows crate 0.46 -> 0.48 in workspace 2023-05-09 18:20:13 +03:00
Nilstrieb f2645776dc Use smaller ints for bitflags 2023-05-07 18:24:46 +02:00
Guillaume Gomez aa87addfb3 Rollup merge of #110417 - jsoref:spelling-compiler, r=Nilstrieb
Spelling compiler

This is per https://github.com/rust-lang/rust/pull/110392#issuecomment-1510193656

I'm going to delay performing a squash because I really don't expect people to be perfectly happy w/ my changes, I really am a human and I really do make mistakes.

r? Nilstrieb

I'm going to be flying this evening, but I should be able to squash / respond to reviews w/in a day or two.

I tried to be careful about dropping changes to `tests`, afaict only two files had changes that were likely related to the changes for a given commit (this is where not having eagerly squashed should have given me an advantage), but, that said, picking things apart can be error prone.
2023-04-18 14:50:51 +02:00
Josh Soref e09d0d2a29 Spelling - compiler
* account
* achieved
* advising
* always
* ambiguous
* analysis
* annotations
* appropriate
* build
* candidates
* cascading
* category
* character
* clarification
* compound
* conceptually
* constituent
* consts
* convenience
* corresponds
* debruijn
* debug
* debugable
* debuggable
* deterministic
* discriminant
* display
* documentation
* doesn't
* ellipsis
* erroneous
* evaluability
* evaluate
* evaluation
* explicitly
* fallible
* fulfill
* getting
* has
* highlighting
* illustrative
* imported
* incompatible
* infringing
* initialized
* into
* intrinsic
* introduced
* javascript
* liveness
* metadata
* monomorphization
* nonexistent
* nontrivial
* obligation
* obligations
* offset
* opaque
* opportunities
* opt-in
* outlive
* overlapping
* paragraph
* parentheses
* poisson
* precisely
* predecessors
* predicates
* preexisting
* propagated
* really
* reentrant
* referent
* responsibility
* rustonomicon
* shortcircuit
* simplifiable
* simplifications
* specify
* stabilized
* structurally
* suggestibility
* translatable
* transmuting
* two
* unclosed
* uninhabited
* visibility
* volatile
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-17 16:09:18 -04:00
Nilstrieb 7859a8e9a5 Don't use serde_json to serialize a simple JSON object
This avoids `rustc_data_structures` depending on `serde_json` which
allows it to be compiled much earlier, unlocking most of rustc.
2023-04-16 15:00:06 +02:00
Nilstrieb 73417b1e15 Inline format_args
Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-09 23:29:39 +02:00
Nilstrieb f058d05fc2 Some simple clippy::perf fixes 2023-04-09 21:59:28 +02:00
John Kåre Alsaker 6c57dda44d Remove unique and move VerboseTimingGuard fields into a new struct 2023-03-21 18:41:45 +01:00
John Kåre Alsaker f60d2eb6c1 Add -Z time-passes-format to allow specifying a JSON output for -Z time-passes 2023-03-21 18:18:25 +01:00
Andy Russell bb7c373fdf migrate compiler, bootstrap, and compiletest to windows-rs 2023-03-20 13:19:35 -04:00
Maybe Waffle 8751fa1a9a if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
John Kåre Alsaker 9539737008 Make an optimal cold path for query_cache_hit 2023-02-06 15:22:12 +01:00
John Kåre Alsaker e60ccfc6a9 Don't inline query_cache_hit to reduce code size of the query hot path. 2023-02-06 13:52:17 +01:00
nils fd7a159710 Fix uninlined_format_args for some compiler crates
Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
2023-01-05 19:01:12 +01:00
Jeremy Stucki 3dde32ca97 rustc: Remove needless lifetimes 2022-12-20 22:10:40 +01:00
KaDiWa 9bc69925cb compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
Maybe Waffle f2b97a8bfe Remove useless borrows and derefs 2022-12-01 17:34:43 +00:00
Nicholas Nethercote 4e8faff3a1 Be consistent about deciding whether to print pass data.
`print_time_passes_entry` unconditionally prints data about a pass. The
most commonly used call site, in `VerboseTimingGuard::drop`, guards it
with a `should_print_passes` test. But there are a couple of other call
sites that don't do that test.

This commit moves the `should_print_passes` test within
`print_time_passes_entry` so that all passes are treated equally.
2022-10-06 15:50:10 +11:00
Nicholas Nethercote 9110d925d0 Remove -Ztime option.
The compiler currently has `-Ztime` and `-Ztime-passes`. I've used
`-Ztime-passes` for years but only recently learned about `-Ztime`.

What's the difference? Let's look at the `-Zhelp` output:
```
  -Z        time=val -- measure time of rustc processes (default: no)
  -Z time-passes=val -- measure time of each rustc pass (default: no)
```
The `-Ztime-passes` description is clear, but the `-Ztime` one is less so.
Sounds like it measures the time for the entire process?

No. The real difference is that `-Ztime-passes` prints out info about passes,
and `-Ztime` does the same, but only for a subset of those passes. More
specifically, there is a distinction in the profiling code between a "verbose
generic activity" and an "extra verbose generic activity". `-Ztime-passes`
prints both kinds, while `-Ztime` only prints the first one. (It took me
a close reading of the source code to determine this difference.)

In practice this distinction has low value. Perhaps in the past the "extra
verbose" output was more voluminous, but now that we only print stats for a
pass if it exceeds 5ms or alters the RSS, `-Ztime-passes` is less spammy. Also,
a lot of the "extra verbose" cases are for individual lint passes, and you need
to also use `-Zno-interleave-lints` to see those anyway.

Therefore, this commit removes `-Ztime` and the associated machinery. One thing
to note is that the existing "extra verbose" activities all have an extra
string argument, so the commit adds the ability to accept an extra argument to
the "verbose" activities.
2022-10-06 15:49:44 +11:00
Nicholas Nethercote eea06de0c8 Fix some comments.
- It's `--print`, not `--prints`.
- `-Ztime` and `-Ztime-passes` print to stderr, not stdout.
2022-10-06 14:22:12 +11:00
Rida Dzhaafar c41630735c Fixed RSS reporting on macOS 2022-06-22 15:24:54 +03:00
Gary Guo 8b7299dd12 Remove likely! and unlikely! macro from compiler 2022-06-18 04:52:11 +01:00
Eduard-Mihai Burtescu d76573abd1 Integrate measureme's hardware performance counter support. 2022-06-13 07:56:47 +00:00
bors d60b4f52c9 Auto merge of #95454 - randomicon00:fix95444, r=wesleywiser
Fixing #95444 by only displaying passes that take more than 5 millise…

As discussed in #95444, I have added the code to test and only display prints that are greater than 5 milliseconds.

r? `@jyn514`
2022-05-06 17:52:47 +00:00
Peh e79ba76ec4 Fixing #95444 by only displaying passes that take more than 5 milliseconds
95444: Adding passes that include memory increase

Fix95444: Change the substraction with the abs_diff() method

Fix95444: Change the substraction with abs_diff() method
2022-05-05 23:56:40 +00:00
Rémy Rakic 7585269673 add generic_activity_with_arg_recorder to the self-profiler
This allows profiling costly arguments to be recorded only when `-Zself-profile-events=args` is on: using a closure that takes an `EventArgRecorder` and call its `record_arg` or `record_args` methods.
2022-04-07 15:47:20 +02:00
Rémy Rakic 1c4ae7aa4a turn exec comment into doc comment 2022-04-07 15:47:19 +02:00
est31 15de4cbc4b Remove redundant [..]s 2021-12-09 00:01:29 +01:00
Ryan Levick 947a33bf20 Add support for artifact size profiling 2021-10-07 14:22:29 +02:00
Frank Steffahn bf88b113ea Fix typos “a”→“an” 2021-08-22 15:35:11 +02:00
Ryan Levick b5bec17184 Add docs to new methods 2021-07-07 11:14:14 +02:00
Ryan Levick 6e33dce9c2 Profile incremental hashing 2021-07-07 10:43:30 +02:00
Eduard-Mihai Burtescu 6165d1cc72 Print -Ztime-passes (and misc stats/logs) on stderr, not stdout. 2021-02-18 14:13:38 +02:00
Tyson Nottingham 4253919f1d Indicate change in RSS from start to end of pass in time-passes output
Previously, this was omitted because it could be misleading, but the
functionality seems too useful not to include.
2021-02-05 01:11:52 -08:00
Tyson Nottingham 849dc1a20c Indicate both start and end of pass RSS in time-passes output
Previously, only the end of pass RSS was indicated. This could easily
lead one to believe that the change in RSS from one pass to the next was
attributable to the second pass, when in fact it occurred between the
end of the first pass and the start of the second.

Also, improve alignment of columns.
2021-01-29 12:46:29 -08:00
LingMan a56bffb4f9 Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
Wesley Wiser efe703a01a [self-profiling] Include the estimated size of each cgu in the profile
This is helpful when looking for CGUs where the size estimate isn't a
good indicator of compilation time.

I verified that moving the profiling timer call doesn't affect the
results.
2020-11-03 07:55:17 -05:00
Wesley Wiser 5ac5556d63 Upgrade to measureme 9.0.0 2020-10-24 22:39:42 -04:00
Camille GILLOT 0a4d948b4a Remove unused ProfileCategory. 2020-10-22 22:35:32 +02:00
est31 43193dcb88 Use as_secs_f64 in profiling.rs 2020-09-20 10:27:14 +02:00
mark 9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00