MATLAB: Is the laptop faster than the Amazon Cloud

ec2 instance performance

I have a mac laptop with a 2.2 GHz Intel Core i7. I believe my laptop has four cores.
I just ran an instance on the EC2 Amazon Cloud Cluster Compute Eight Extra Large Instance (cc2.8xlarge). I believe such an instance is equivalent to renting a computer with an Intel Xeon E5-2670 chip if the AWS web pages are to be believed. This chip is often clocked at 2.6 GHz and has 8 real cores (16 virtual ones).
On the one hand, parfor loops definitely run faster in the cloud. However, there are several pieces of my code which are not parallelized where my laptop runs faster than the instance (0.6 vs. 1.2 seconds, 3.2 vs. 5.5 seconds, 4.9 vs. 7.7 seconds). How can my laptop possibly be so much faster than the cloud?
(I believe I am giving CPU times. The wall times in the cloud appear to be substantially longer by factors of two or three.)

Best Answer

Remember that all MDCS workers run in single computational thread mode. This means that where functions are intrinsically multi-threaded by MATLAB, you might expect to see this sort of effect. You might try comparing EC2 workers against the 'local' workers on your laptop which are also in single computational thread mode.
Related Question