How to fix slow GRUB boot menu on 4K screens in Linux

Linux

In case you have a screen with a high resolution, a 4K screen for example, it is possible that GRUB is incredibly slow. If that is the case, the workaround is to edit the /etc/default/grub file, and add/replace the following line

GRUB_GFXMODE=1280x1024x32,auto

Then run "update-grub" to update GRUB.
This will run GRUB in 1280x1024x32 resolution, which is the workaround for this problem.
Please make sure the resolution is supported. The "auto" means that GRUB will fall back to auto detect in case the resolution isn't supported.