From 9daad20cf979b8f1480af1a59ae758c9ba75e6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Sun, 19 Jul 2026 12:08:18 +0200 Subject: [PATCH] Skip unused work in discovery post-processing and output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The WriteScreen plugin flattened the whole discovered tree with View-Flat on DiscoveryEnd, but the result is only read when Run.SkipRun is set or verbosity is Detailed/Diagnostic, in the default run it was computed and thrown away. It is now computed only when one of those consumers can read it. The RSpec decoration walk (Add-RSpecTestObjectProperties per test) and Remove-RSpecNonPublicProperties used Fold-Container/Fold-Run, which pay a scriptblock dispatch per item and an advanced-function recursion per block. Both are now direct recursive loops that visit the same items in the same pre-order. Format-Nicely2 called Is-DecimalNumber, Is-ScriptBlock, Is-Collection and Is-Value helpers on every formatted value, on the dispatch path used for every