Yam is better for CPU mining if you run it as root in linux or administrator in windows.. Since now it gives you 20% more hashing power.
does this also work running the command with sudo?
It should. Sudo is almost equivalent to being root. I think the only difference is some variables that carry over from the user account, but I doubt that would prevent Yam from running at full power.