If it's a really early cannon rush you're usually screwed by the time the cannon is finished. Your best bet is probably to take whatever units you got and attack. Chances are he built the forge before the the warpgate and has little if anything to defend.
I'm noob... maybe it pays off to take them out, but it's definitely more resource intensive on your part. I think it's better to counter attack.