I am parsing my page with selenium and i am handling javascript alert messages with selenium to. But this is very slow to check every page if it has JS alert popup message b
A future enhancement to webdriver will be to throw an exception on any command if an alert is present.
The current implementation of SwitchTo().Alert() causes a small sleep delay because it has to wait for the browser to propagate the events for the alert window to appear (IIRC it's 300ms).
For now what you have is your best bet for when you don't know for sure if an alert will appear on the page. In the future you should be able to catch a different exception for regular commands that don't have the delay built in.