I'm trying to play Minecraft (non-modded, no shaders, with 4Gb allocated memory, with all new drivers installed), but I keep on having really low (around 40FPS) whether I use CPU's GPU or the Nvidia GPU. On other games I don't have such a problem, plus that my laptop runs without problem programs like Matlab. My laptop's power mode is in the "best-performance" mode (HP OMEN model). How could I fix this?
It's the very nature of Nvidia Optimus that is the problem. There is a significant bottleneck when the display is connected to the dGPU via the iGPU. The only way to solve this issue is to connect the laptop to an external monitor or get a laptop that has the ability to run the display off the dGPU (Lenovo Legion series, G-Sync laptops, Some Aorus laptops).
post an ingame screenshot with the F3 screen up, and your JVM arguments
Well, my problem was with the Nvidia GeForce Experience. The settings in GeForce Experience were locked at 30FPS for battery-saving purposes... I changed it and the problem solved. You can lock the post if you feel so.