rust/tests/ui/doc
Timo 98555244f0
[PERF] Don't spawn so many compilers (3/2) (19m -> 250k) (#15030)
Optimize `needless_doctest_main`, make it short-circuit, make sure that
we don't spin up a new compiler on EVERY code block.

---

The old implementation was creating a new compiler, new parser, new
thread, new SessionGlobals, new everything for each code block. No
matter if they actually didn't even contain `fn main()` or anything
relevant.

On callgrind, seems that we're reducing about a 6.7242% de cycle count
(which turns out to be a 38 million instruction difference, great!).
Benchmarked in `bumpalo-3.16.0`. Also on bumpalo we spawn 78 less
threads. This moves `SessionGlobals::new` from the top time-consuming
function by itself in some benchmarks, into one not even in the top 500.

Also, populate the test files.

changelog:[`needless_doctest_main`]: Avoid spawning so many threads in
unnecessary circumstances
2025-06-20 21:58:45 +00:00
..
doc-fixable.fixed Add unsafe markers to accomodate edition 2024 rules 2025-04-15 20:33:01 +02:00
doc-fixable.rs Add unsafe markers to accomodate edition 2024 rules 2025-04-15 20:33:01 +02:00
doc-fixable.stderr Add unsafe markers to accomodate edition 2024 rules 2025-04-15 20:33:01 +02:00
doc_comment_double_space_linebreaks.fixed doc_comment_double_space_linebreaks: Fix tests 2025-03-01 12:15:24 +01:00
doc_comment_double_space_linebreaks.rs doc_comment_double_space_linebreaks: Fix tests 2025-03-01 12:15:24 +01:00
doc_comment_double_space_linebreaks.stderr doc_comment_double_space_linebreaks: Fix tests 2025-03-01 12:15:24 +01:00
doc_include_without_cfg.fixed Update UI tests 2025-02-15 13:38:16 +01:00
doc_include_without_cfg.rs Update UI tests 2025-02-15 13:38:16 +01:00
doc_include_without_cfg.stderr Update UI tests 2025-02-15 13:38:16 +01:00
doc_lazy_blockquote.fixed Merge commit 'b794b8e08c' into clippy-subtree-update 2024-07-11 15:44:03 +02:00
doc_lazy_blockquote.rs Merge commit 'b794b8e08c' into clippy-subtree-update 2024-07-11 15:44:03 +02:00
doc_lazy_blockquote.stderr Merge commit 'b794b8e08c' into clippy-subtree-update 2024-07-11 15:44:03 +02:00
doc_lazy_list.fixed Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
doc_lazy_list.rs Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
doc_lazy_list.stderr Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
doc_markdown-issue_13097.fixed Review comments & Add testing 2025-05-21 23:44:28 +02:00
doc_markdown-issue_13097.rs Review comments & Add testing 2025-05-21 23:44:28 +02:00
doc_markdown-issue_13097.stderr Review comments & Add testing 2025-05-21 23:44:28 +02:00
doc_nested_refdef_blockquote.fixed Merge commit '609cd310be' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
doc_nested_refdef_blockquote.rs Merge commit '609cd310be' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
doc_nested_refdef_blockquote.stderr Merge commit '609cd310be' into clippy-subtree-update 2024-12-26 15:15:54 +01:00
doc_nested_refdef_list_item.fixed Fix ICE 2025-02-27 10:18:44 +01:00
doc_nested_refdef_list_item.rs Fix ICE 2025-02-27 10:18:44 +01:00
doc_nested_refdef_list_item.stderr Fix ICE 2025-02-27 10:18:44 +01:00
doc_overindented_list_items.fixed Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
doc_overindented_list_items.rs Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
doc_overindented_list_items.stderr Merge commit '51d49c1ae2' into clippy-subtree-update 2025-01-28 19:33:54 +01:00
footnote_issue_13183.rs Update UI tests 2025-02-15 13:38:16 +01:00
issue_902.rs Update UI tests 2025-02-15 13:38:16 +01:00
issue_1832.rs Update UI tests 2025-02-15 13:38:16 +01:00
issue_9473.fixed Update UI tests 2025-02-15 13:38:16 +01:00
issue_9473.rs Update UI tests 2025-02-15 13:38:16 +01:00
issue_9473.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
issue_10262.fixed Merge commit '9d6f41691e' into clippy-subtree-update 2024-03-21 22:20:40 +01:00
issue_10262.rs Merge commit '9d6f41691e' into clippy-subtree-update 2024-03-21 22:20:40 +01:00
issue_10262.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
issue_12795.fixed Fix new tests updates 2025-02-15 13:38:42 +01:00
issue_12795.rs Fix new tests updates 2025-02-15 13:38:42 +01:00
issue_12795.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
link_adjacent.fixed doc_link_code: add check for text[adjacent] style links 2025-01-30 16:10:05 -07:00
link_adjacent.rs doc_link_code: add check for text[adjacent] style links 2025-01-30 16:10:05 -07:00
link_adjacent.stderr Merge remote-tracking branch 'upstream/master' into rustup 2025-02-20 15:26:07 +01:00
needless_doctest_main.rs [PERF] Don't spawn so many compilers (3/2) (19m -> 250k) (#15030) 2025-06-20 21:58:45 +00:00
needless_doctest_main.stderr Even more optimizing documentation lints? (3/2) 2025-06-20 12:07:35 +02:00
unbalanced_ticks.rs Merge remote-tracking branch 'upstream/master' into rustup 2025-02-20 15:26:07 +01:00
unbalanced_ticks.stderr ui_test annotation cleanup 2025-02-16 16:51:35 +00:00