Out of curiousity I tested that particular statement, and you're right. Compared to
$('#foo').attr('bar', 'baz');
your code is30 times faster in Chrome 9
81 times faster in Firefox 3.6
$('#foo').attr('bar', 'baz');
your code is30 times faster in Chrome 9
81 times faster in Firefox 3.6