rust/compiler
bors b652d9a0fd Auto merge of #108062 - Zoxc:spec-incr, r=cjgillot
Specialize query execution for incremental and non-incremental

This specializes query execution for incremental and non-incremental by passing in a separate `dyn QueryEngine` types, taking advantage of the virtual dispatch to avoid a branch. This ends up duplicating `try_execute_query`, hopefully the compile time cost of that is relatively low.

This is a performance improvement for the non-incremental path:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8420s</td><td align="right">1.8331s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2652s</td><td align="right">0.2631s</td><td align="right"> -0.78%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0161s</td><td align="right">1.0062s</td><td align="right"> -0.98%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6408s</td><td align="right">1.6197s</td><td align="right">💚  -1.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3939s</td><td align="right">6.3558s</td><td align="right"> -0.60%</td></tr><tr><td>Total</td><td align="right">11.1580s</td><td align="right">11.0780s</td><td align="right"> -0.72%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9918s</td><td align="right"> -0.82%</td></tr></table>

The incremental path is more neutral:
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.2210s</td><td align="right">2.2227s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3441s</td><td align="right">0.3443s</td><td align="right"> 0.05%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2919s</td><td align="right">1.2877s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0749s</td><td align="right">2.0721s</td><td align="right"> -0.14%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.9266s</td><td align="right">7.9206s</td><td align="right"> -0.07%</td></tr><tr><td>Total</td><td align="right">13.8585s</td><td align="right">13.8474s</td><td align="right"> -0.08%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9992s</td><td align="right"> -0.08%</td></tr></table>

r? `@cjgillot`
2023-05-16 16:02:53 +00:00
..
rustc
rustc_abi Reorder to keep duplicate checks in sync. 2023-05-05 16:30:32 -07:00
rustc_apfloat
rustc_arena Deny the unsafe_op_in_unsafe_fn lint in 2023-04-28 21:00:54 -07:00
rustc_ast refactor: add chunks method to TokenStream to obviate rustdoc clones 2023-05-13 16:59:28 -05:00
rustc_ast_lowering Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
rustc_ast_passes Add feature gate 2023-05-05 21:44:48 +02:00
rustc_ast_pretty Migrate offset_of from a macro to builtin # syntax 2023-05-05 21:44:13 +02:00
rustc_attr Improve check-cfg diagnostics (part 2) 2023-05-05 13:06:48 +02:00
rustc_baked_icu_data Regen baked data 2023-05-02 10:45:16 -07:00
rustc_borrowck Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_builtin_macros Rollup merge of #111463 - clubby789:env-escaped-var, r=cjgillot 2023-05-14 08:21:39 +02:00
rustc_codegen_cranelift use EarlyBinder in tcx.(try_)subst_mir_and_normalize_erasing_regions 2023-05-06 22:32:39 -06:00
rustc_codegen_gcc Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_codegen_llvm Auto merge of #107707 - calebzulawski:remove-features, r=Amanieu 2023-05-15 18:47:52 +00:00
rustc_codegen_ssa Auto merge of #107707 - calebzulawski:remove-features, r=Amanieu 2023-05-15 18:47:52 +00:00
rustc_const_eval Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk 2023-05-16 11:39:39 +02:00
rustc_data_structures Start node has no immediate dominator 2023-05-14 16:09:58 +02:00
rustc_driver
rustc_driver_impl Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_error_codes Rollup merge of #111215 - BoxyUwU:resolve_anon_consts_differently, r=cjgillot 2023-05-09 20:49:32 +02:00
rustc_error_messages correct literals for dyn thread safe 2023-05-06 09:34:53 +08:00
rustc_errors Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_expand introduce DynSend and DynSync auto trait 2023-05-06 09:34:18 +08:00
rustc_feature fixup version placeholder for cfi_encoding feature 2023-05-15 19:19:13 +03:00
rustc_fluent_macro Remove unused synstructure dep 2023-04-22 22:03:33 +01:00
rustc_fs_util
rustc_graphviz enable rust_2018_idioms for doctests 2023-05-07 00:12:29 +03:00
rustc_hir Require impl Trait in associated types to appear in method signatures 2023-05-12 10:24:03 +00:00
rustc_hir_analysis Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillot 2023-05-15 17:12:46 +02:00
rustc_hir_pretty Rip it out 2023-05-01 16:15:13 +08:00
rustc_hir_typeck Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillot 2023-05-15 17:12:46 +02:00
rustc_incremental Rollup merge of #111024 - saethlin:stringify-full-svh, r=oli-obk 2023-05-04 08:09:04 +02:00
rustc_index Decorative changes to IndexVec 2023-04-24 13:53:37 +00:00
rustc_infer Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk 2023-05-16 11:39:39 +02:00
rustc_interface Auto merge of #108062 - Zoxc:spec-incr, r=cjgillot 2023-05-16 16:02:53 +00:00
rustc_lexer Don't try to eat non-existent decimal digits. 2023-05-15 18:33:12 +10:00
rustc_lint Rollup merge of #111572 - kpreid:mdi, r=compiler-errors 2023-05-16 11:39:39 +02:00
rustc_lint_defs Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum 2023-05-08 04:50:28 +00:00
rustc_llvm Usage of atomic counters for llvm code coverage 2023-05-12 01:40:04 +03:00
rustc_log
rustc_macros Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_metadata Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_middle Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk 2023-05-16 11:39:39 +02:00
rustc_mir_build Auto merge of #105750 - oli-obk:valtrees, r=lcnr 2023-05-16 13:10:24 +00:00
rustc_mir_dataflow Auto merge of #110820 - cjgillot:faster-dcp, r=oli-obk 2023-05-10 20:54:31 +00:00
rustc_mir_transform Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_monomorphize Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_parse Recover impl<T ?Sized> correctly 2023-05-15 17:14:59 +00:00
rustc_parse_format
rustc_passes Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_plugin_impl
rustc_privacy Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_query_impl Auto merge of #108062 - Zoxc:spec-incr, r=cjgillot 2023-05-16 16:02:53 +00:00
rustc_query_system Specialize query execution for incremental and non-incremental 2023-05-14 21:53:05 +02:00
rustc_resolve Rollup merge of #111428 - bvanjoi:fix-109250, r=Nilstrieb 2023-05-16 11:39:38 +02:00
rustc_serialize Fix the FileEncoder buffer size. 2023-05-15 08:59:11 +10:00
rustc_session Auto merge of #107586 - SparrowLii:parallel-query, r=cjgillot 2023-05-13 13:47:53 +00:00
rustc_smir Encode types in SMIR 2023-05-08 14:23:19 +00:00
rustc_span Simplify find_width_of_character_at_span. 2023-05-14 16:24:11 +02:00
rustc_symbol_mangling Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_target asm: loongarch64: Drop efiapi 2023-05-12 17:22:47 +08:00
rustc_trait_selection Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obk 2023-05-16 11:39:39 +02:00
rustc_traits Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
rustc_transmute Remove unused TypeFoldable/TypeVisitable impls. 2023-04-26 15:19:50 +10:00
rustc_ty_utils Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillot 2023-05-15 17:12:46 +02:00
rustc_type_ir Implement references VarDebugInfo. 2023-05-13 10:12:14 +00:00