My sluggish computer and how I decided on specs while looking for a new one

13 Jul, 2013 05:07 AM
 gadget
 performance
I have a white Apple Macbook 13inch (mid-2006). While it has served me well for last 7 years brilliantly for my development needs, surfing, email and occasional gaming, off-late I have stated using Adobe tools like photoshop and illustrator and it gets sluggish when I open my usual apps and then I open a heavy Adobe Illustrator file. It takes ages to open and then all other apps become un-responsive. I had to do something about it as my performance took a nosedive. I took upon to see what is the bottleneck in my system that is causing this behaviour and how to address it. It was a learning experience and sharing it here.

My Macbook 
I run a lot of applications together including Photoshop, Illustrator, development tools like Phpstorm, Xcode and SourceTree. I also run background processes like Apache, Mysql and Hudson. Plus a bunch of chrome and safari browser windows/tabs running gmail, news sites, facebook and the like.

When I'm running at peak load i.e. when all the above programs are running I see two kinds of behaviour - 
1. I have good performance - I can switch between apps easily and they are instantly responsive, meaning all of them are in RAM (at least most frequently accessed pages of the virtual memory are). I can also see that the swap size and disk I/O activity is constant and not changing during app switching which confirms my assumption here.

2. I have very poor performance - I find it hard to switch between apps and when the switch eventually happens, the apps are not responsive to the extent that I'm pulling my hair in frustration. When I observe the disk i/o and swap size, I see in this condition that there is high disk activity during application switching and also during interacting within the application (like clicking of menus and buttons). It means there is swapping happening between RAM and Disk even though there might not be a net swap size increase.

The interesting point I have noticed is that the second condition happens when I open resource intensive application after opening the other applications. Example, I open a massive illustrator file after opening the other applications. It gets into a loop of swapping existing applications into disk to accommodate new resource intensive application and thus the app launching is slow. And during switching it gets into a perpetual loop of swapping back and forth the applications VM pages between RAM and Swap Space on disk. Since the resource intensive application was launched at the end when memory was low it got the last seat and has to run between extended memory in swap space and RAM. 

Following things come to my mind to improve the situation - 

1. more RAM to accommodate more pages in memory
2. switch to SSD from HDD to make disk i/o faster
3. latest and faster CPU

There are two problems when I'm working in this setup. The app launch time and app responsiveness when switching between multiple applications. To improve launch time I need a faster disk I/O. Thats easy - get a SSD.

To increase responsiveness during run I need more RAM to accommodate the application (or at least parts of it). How much RAM? Activity Monitor shows I have consumed 3 GB RAM (Thats the max my system will recognise out of 4 GB I have) and 2.5 GB of Swap Space, meaning if I had 5.5 GB of RAM they would all fit in without the need for using swap space (Approximately).

CPU is not a bottleneck at all with kind of applications I run and the way I use them (I don't run computationally intensive algorithmic tasks in Photoshop or Illustrator).

Following Apple laptops fit into my requirement - 
1. Macbook Air - Portable (which is my need), beautiful (for my eyes) but has only 4GB RAM and latest but lower clock speed CPU (Haswel Dual Core 1.3 GHz).
2. Retina Macbook Pro - Powerful CPU (2 GHz+), 8 GB RAM but slightly heavier (Even the 13 inch compared to Air) and looks less attractive compared to Air. 

(iMac in India does not ship with SSD and there is no build to order option in India)

I took a chance that SSD + RAM would work fast enough for me in latest Air model with all new PCIE interface for SSD to offset the lower RAM available in it and went ahead and bought it. And I don't regret it after1 month of usage. its been super fast in loading the apps and despite swap space being used, its hardly noticeable. I had this feeling that Air models are not for development work but now I stand corrected. Adios!