by design and at default settings this is exactly how its supposed to behave. The CPU is throttled to conserve battery.
You can change this if you want.
Control panel>Power Oprtions>Show additional plan settings>select high performance>Change plan settings>Change advanced power settings>Scroll down to processor power management>Expand......Then choose your minimum processor state and maximum processor states as desired.
Caveat, your battery run time will be diminished. Its pretty much a given that high performance laptops are not meant to crunch algorithms or run resource intensive apps and games while on battery. Want to watch a movie, do some word processing, browse the web, no problem. Want to play Witcher 3 or GTAV break out the power brick and expect that at some times that the power brick is not even enough and it will take power from batteries at short intervals.
“Two things are infinite: the universe and human stupidity, I'm not sure about the former” ~ Albert Einstein