In general, this is impossible to answer. For ultimate speed, you want many cores, a fast clock speed, fast disk access, and a good system fan. Other factors too, such as cache memory, graphics card, etc.
Which is more important? Again, impossible to know, because it will fully depend on what you will be doing, EXACTLY which problems you will be solving. In fact, there are often subtly different schemes and algorithms you might use to optimize your code, depending on your hardware. So your choice of hardware might easily influence your code.
Essentially, get the best computer you can afford. I would point out that IF you were truly looking for optimal performance, a laptop system might not be your best choice, as systems will often see performance degradation under heavy use if they heat up. The CPU necessarily slows down to avoid heating problems. This will happen when you are running flat out all of those cores the manufacturer pushes on you, convincing you that you are getting true power. The fan then often does not suffice, your CPU gets hot, and your clock speed automatically throttles down. The point is, the fastes computer you can get for flat out performance will have a superb cooling system, and that will not fit well in a small laptop case. So if you really want performance, then the biggest source of impact on ultimate performance may well be the fact that you chose a laptop in the first place.