I was running some performance tests to see if i could use jQuery directly instead of Ext's wrapper. To start with i wanted to compare jQuery(#id) to doc.getElementById, but i must be doing something wrong, since jQuery(#id) is awful slower.
var searchDoc = searchWin.document;
var jqSearchDoc = jQuery(searchWin.document);
for (var i=0; i<500; i++){
var temp = jqSearchDoc.find('#myID'); //takes 1100ms
//var temp = jQuery(searchDoc.getElementById('myID')); //takes 3ms
}
Any idea why the uncommented line is so much slower? and how to rewrite it?