How do I limit Pamac or yay's CPU core usage while compiling?

I mean since the job is being split among many threads anyway, but is being split without necessity. This means that it must be doing a ton of context-switching which seems quite wasteful. Is there a way or not?