Posts Tagged ‘windows 7’

Page Faults and Context Switches: Chrome, Flash and Techcrunch are killing my system

Update: Beta News reported a similar performance drop when running chrome 3.0.193.1 on Windows 7 RC

I am a power user. When I surf, I have around 20-25 tabs open. I have many processes running simultaneously on my windows 7 RC.TaskManager When I code, I have a test Ubuntu installation running on VMware.  To do all these, I spent most of my earnings on a 17″, Core2duo 2.4Ghz, 4GB ram, NVidia 8600M GT Dell Inspiron Laptop 1720. I have been using Google Chrome since the day it was made available and i keep up with the latest builds of the same. I also love the fact that it was zipper than my earlier favorite(Firefox) in opening new tabs. But, the whole time Google Chrome has been stressing my laptop’s hardware.

To prove my point, take look at the screenshots from Process Explorer, a Task Manager replacement for Windows. The Laptop was restarted and the screenshots were taken after around 4-5 hours of casual browsing with around 25 tabs open. I also had a Hadoop installation running on a VMware Player. Simultaneously, I was also dabbling  around with some code in eclipse .

The following were my observations

  • The Browser Process of Chrome is doing over 10 Million Page Faults. The closest that comes to this process is the Microsoft AntiMalware service(Morro engine) at 2 Million. As you can see in screenshot 1(below), the whole top list is dominated by Chome processes.
  • The Flash process has over 70 Million Context Switches(see screenshot 2(below) which was taken 20 odd minutes after screenshot 1), @5000 Context Switches/sec which is quite appalling.  The nearest competitors are Interrupts, Chrome again, Google Talk (Another Windows Application from Google)
  • Lastly, Techcrunch.com, Mike Arrington’s “Bloat-ware” Blog , one tab of which is taking around 500MB of RAM taking the total RAM occupied by all  Chrome  processes at 1.05Gb (Note: Firefox was really good at this. I seldom get past 400-500 MB on that many number of tabs). Also funny thing is that,  if you compare Techcrunch to Gmail, the latter  just takes 64MB of ram(see Chrome’s Process Manager screenshot above)

Let me teach my readers a quick Computer Science 101. The following explanations are over simplified, so if you are not satisfied with the explanation, go read Wikipedia for a detailed discussion over the same.

Page Fault: When a processor tries to fetch some block of data from the memory, if doesn’t find the data in the memory it tries to get that data from the hard disk. Operating system manages the blocks of memory and moves some of them to the HDD based on Most Recently used criterion. Since you know the over head of a disk access is way larger than a memory access, too many page faults translate to more spinning of the hard disk. Read Wikipedia for a detailed description

Context Switch: In a multiprocess environment like windows. The cost of switching from one process to another process is quite high. If an application keeps switching very fast, that means it’s not getting enough cpu time to do its work, and it is wreaking havoc on the other applications by decreasing their effective cpu time also. Read Wikipedia for a detailed description

Few things come out of this little insight

  • Flash NPAPI plugin is a useless piece of crap. Even after 10 major versions, they still have an ill designed system. (Some people have told me this was specific to chrome as according to them Flash runs fine on Firefox)
  • Chrome even though is very fast in terms of HTML rendering and JavaScript execution. But, it kills the system by the large number of PageFaults and Context Switches it does.
  • Techcrunch seems to be doing more job than a complex web-application like Gmail. Or is it because the 20 odd flash ads they have on their Blog. They could be even doing mouse pointer/user tracking or even Javascript  code Instrumentation. Who knows!(Just Kidding). What ever it is, they need to find and fix the root cause of the problem.

If my readers believe they are also suffering from the same fate as I am, I would request them to put their stats up in the comments section.

I am using Chrome 3.0.193.0 with Flash 10.0 on a Win7 RC ( Yeah I know that it’s a unstable combination. But, even when I was using Chrome 2.0 on Vista SP1 with Flash 9, I had the same problem)

Process ExplorerProcess Explorer2

Advertisements

Enable Multitouch(two-fingers) on Synaptics trackpad for Windows xp/Vista/7

This could be your Trackpad

This could be your Trackpad

Very few people know that every synaptics trackpad supports multitouch and as long as your OS supports it you can always use multitouch to enhance your computers interface. Apple has patented several UI design elements ,hence has inhibited Windows and Linux to come out with similar UI elements like pinch and zoom, scroll etc.

 
linux-online-incIf you are using Linux and want to setup multitouch then click here 

signature_color_high_res_0

You only need a patched driver to enable multitouch features in synaptics. Download the latest driver from here

Download links (for XP/Vista 32/64-bit):
http://www.sendspace.com/file/9n9c6i
http://mihd.net/42vtopk

This driver is made from an outdated driver of synaptics. So you may have to uninstall your existing driver

  1. Go to Add-Remove Software. 
  2. Find and uninstall synaptic driver
  3. Reboot

Extract the zip file(touchpad_synaptics_v10.2.4_vistax32x64_xpx32x64_modded_build2.zip) to a folder

Install selected driver.

This driver is not signed. Hence windows will issue a warning. Do not install this driver on your production machine. This is a development build and using it may crash your system

Now you can  enable these 3 features on your Windows Desktop using Synaptic Options. Go to bottom right in your Windows taskbar to select synaptics tray icon or search synaptic in control panel. Then select Synaptic touchpad in Device Settings. 

  1. Multitouch scrolling : You will be able to scroll using 2/3 fingers. The scrolling is not as smooth as mac (shucks!!) but works equivalent to page up and page down. Here is how to enable it in Synaptics Options. You can configure what each direction will cause.
    Two finger Gestures -> Top/Bottom/Left/Right
  2. Chiral Motion : This technique is very useful for precise scrolling. Whenever you wish to scroll just slide two fingers downwards(or upwards) and then you can move your fingers in clockwise or anticlockwise order to continue scrolling.This is a much more precise way of scrolling but you need to get used to it. Here is how to enable it in Synaptics Options
    Virtual Scrolling -> Enable Chiral motion scrolling
  3. Momentum : This grants your mouse momentum so if you drag your mouse and leave it. It will travel some more distance depending on the speed of your drag. This is quite cool for some time, but very difficult to handle and impractical. Still somthing cooool to show off :). . Here is how to enable it in Synaptics Options
       Pointer Motion -> Momentum -> Enable Momentum
  4.  

 

UPDATE: The driver has not functioned for some laptops. It is suited only for some laptops. If you have installed this driver, do let us know in the comments if this worked for you. Thanks!!!