1. start emacs with “emacs -Q”
2. eval the following form:
(progn
  (setq ddd-tm (current-time))
  (switch-to-buffer-other-window "*Messages*")
  (message "ddd: %ss"  (float-time (time-subtract (current-time) ddd-tm))))

The result is lager than 0.1s on my machine. This makes undo-tree running too slowly, because it calls switch-to-buffer-other-window twice per undo.

The emacs 25 has no such problem.

OS: Centos 7.4 x86_64
Emacs: 26.0.91
GTK version: 2.24.31