How do I fix Chromium-based browser lags

Ok I managed to solve the lag in both firefox and chromium and therefore the CPU useage on chromium-based browsers are more or less the same as Windows and it works smoothly.

I installed the linux-clear kernel (to install type yay -S linux-clear to get from the AUR). After it compiles you may see some error, the maintainer of the linux-clear kernel in the AUR has advised me not to worry about it. After compilation type sudo grub-mkconfig -o /boot/grub/grub.cfg to put it in the GRUB menu. So after you boot into it ensure you use these flags for the chromium-based browser, otherwise it will not work --ignore-gpu-blacklist, --enable-gpu-rasterization and --enable-oop-rasterization. You can also enable these by typing in chrome://flags and enabling those settings. After that ensure a full system update is performed yay -Syyu to ensure everything is up to date. Then do a reboot and everything should work.

Edit: Do NOT use --enable-oop-rasterization I made a mistake by using that flag, this will cause YouTube videos to not work correctly.