Well, clearly it will take a few more microseconds--possibly milliseconds--to do the setup the second way. After all, it has to loop through all then anchor tags, find the rel attribute, etc., etc.
But who cares? That only happens at page load time. Who will ever see it happen?
The AJAX code is identical and will run at exactly the same speed, when the click actually occurs. (And in both cases should be an invisible amount of time.)
Of course, your second set of code is kind of useless for actually tracking clicks. As it makes no differentiation between *WHICH* <a> was clicked on. Wouldn't it be better to do something like:
anchor.onclick = function ()
ajax = ajaxFunction();
var url = base_url+ "app_trackClicks.php?url=" + this.href;