It is not actually a fault or defect in your machine rather it is your Windows settings that are not allowing your CPU and GPU to perform fully. When your machine is on battery power, the core speeds of CPU and GPU are set to limited to save battery that is why it is performing low, while on AC Power the CPU and GPU are free to utilise their 100% speeds. You can change these settings in Control Panel for High performance.
*For Laptops using Energy/Power Manager Application
Click on 'Show hidden icons' in Notifications Area on Taskbar
Then Click on Energy/Power manager application to open. Here you can Click to set your machine's performance directly.
*For Other(Windows) Users
Go to Control Panel->Click on Hardware and Sound->Power Options
You can also Right Click on Battery icon and Choose Power Options
Here Choose one of your plans
You can also Change Current Plan settings
Click on 'Change plan settings'
Then Click on 'Change Advanced power settings'
A new window will open-up. Where you can set your plan as Balanced, High Performance, Power Saver and Stable Mode.
Choose your taste and Click Apply.