Hypothetical clock speed vs cores

I just thought of a question just for fun and wanted to know the answer. Say there is a program that completely utilizes 4 CPU cores. Would a CPU at 3.0 GHz 4 cores be better or worse than a CPU with 2 cores but 6.0 GHz clock speed? Thanks!