CanvasRenderingContext2D::restore() does m_path.transform(state().m_transform); which is a waste of cycles if the path is empty, or the transform is identity.
Created attachment 91995 [details] Patch
I wonder if putting isEmpty first in the check might make these paths even a little faster. isIdentity() looks at a handful of values on the matrix whereas isEmpty should be checking just a single count variable (platform dependent of course though).
http://trac.webkit.org/changeset/85540