WPF starts slowly. Only the first WPF window in that process; other windows are faster. On most computers the first window should start in less than 1 s.
// script ""
using System.Windows;
using System.Windows.Controls;
//This script measures the time needed to show a WPF window.
for (int i = 0; i < 2; i++) {
perf.first();
timer.after(1, _ => { perf.nw(); }); //when the window is fully loaded, visible and ready for input
ShowWpfWindow();
1.s();
}
void ShowWpfWindow() {
var w = new Window { Title = "WPF window" };
w.Content = new TextBox();
w.ShowDialog();
}
//On my new Win11 computer: first time 300 ms, then 45 ms.
//On my old (year 2014) Win10 computer: first time 600 ms, then 50 ms. After long time first time can be 1.8 s.