These are the timings for running xrandr with hdmi1 enabled and disabled for the patches from comment 14 and 15:
comment14/with-hdmi1-disabled:real 0m0.115s comment14/with-hdmi1-enabled:real 0m0.646s comment15/with-hdmi1-disabled:real 0m0.040s comment15/with-hdmi1-enabled:real 0m0.041s
So the one from comment15 is clearly the winner. Switching feels instant.
These are the timings for running xrandr with hdmi1 enabled and disabled for the patches from comment 14 and 15:
comment14/ with-hdmi1- disabled: real 0m0.115s with-hdmi1- enabled: real 0m0.646s with-hdmi1- disabled: real 0m0.040s with-hdmi1- enabled: real 0m0.041s
comment14/
comment15/
comment15/
So the one from comment15 is clearly the winner. Switching feels instant.