7466d1654758a960990796f5c049e09e475f7766 tdreszer Thu Dec 1 17:12:06 2011 -0800 More timing in hgFileUi and hgFileSearch led to important efficiency changes. Most notable, I am relying upon cached rsync results now to improve speed. diff --git src/hg/hgFileSearch/hgFileSearch.c src/hg/hgFileSearch/hgFileSearch.c index 2fc6832..0b33da2 100644 --- src/hg/hgFileSearch/hgFileSearch.c +++ src/hg/hgFileSearch/hgFileSearch.c @@ -327,31 +327,31 @@ printf("</div>\n"); // End tabs div #endif///def USE_TABS if(nameSearch != NULL && !strlen(nameSearch)) nameSearch = NULL; if(descSearch != NULL && !strlen(descSearch)) descSearch = NULL; if(groupSearch != NULL && sameString(groupSearch, ANYLABEL)) groupSearch = NULL; printf("</form>\n"); printf("</div>"); // Restricts to max-width:1000px; cgiDown(0.8); if (measureTiming) - uglyTime("Rendered tabs"); + uglyTime("Generated search controls"); #ifdef USE_TABS if (doSearch && selectedTab==simpleTab && isEmpty(descSearch)) doSearch = FALSE; #endif///def USE_TABS if(doSearch) { // Now search #ifdef USE_TABS struct slRef *foundTdbs = NULL; if(selectedTab==simpleTab) { foundTdbs = simpleSearchForTdbs(trix,descWords,descWordCount); @@ -378,31 +378,31 @@ { if (nameSearch || descSearch || groupSearch) { // Use nameSearch, descSearch and groupSearch to narrow down the list of composites. if (isNotEmpty(nameSearch) || isNotEmpty(descSearch) || isNotEmpty(groupSearch)) { struct trackDb *tdbList = hTrackDb(db); struct trackDb *tdbsMatch = tdbFilterBy(&tdbList, nameSearch, descSearch, groupSearch); // Now we have a list of tracks, so we need a unique list of composites to add to mdbSelects doSearch = mdbSelectsAddFoundComposites(&mdbSelects,tdbsMatch); } } if (doSearch && mdbSelects != NULL && isNotEmpty(fileTypeSearch)) - fileSearchResults(db, conn, mdbSelects, fileTypeSearch); + fileSearchResults(db, conn, cart, mdbSelects, fileTypeSearch); else printf("<DIV id='filesFound'><BR>No files found.<BR></DIV><BR>\n"); if (measureTiming) uglyTime("Searched for files"); } slPairFreeList(&mdbSelects); } hFreeConn(&conn); webNewSection("About " FILE_SEARCH_NAME); printf("Search for downloadable ENCODE files by entering search terms in " "the Track name or Description fields and/or by making selections with " "the group, data format, and/or ENCODE metadata drop-downs."); @@ -441,31 +441,31 @@ jsIncludeFile("ddcl.js",NULL); printf("<script type='text/javascript'>var newJQuery=true;</script>\n"); printf("<script type='text/javascript'>$(document).ready(function() { findTracks.updateMdbHelp(0); });</script>\n"); #else///ifndef NEW_JQUERY printf("<script type='text/javascript'>var newJQuery=false;</script>\n"); printf("<script type='text/javascript'>$(document).ready(function() { findTracks.updateMdbHelp(0); $('.filterBy').each( function(i) { $(this).dropdownchecklist({ firstItemChecksAll: true, noneIsAll: true, maxDropHeight: filterByMaxHeight(this) });});});</script>\n"); #endif///ndef NEW_JQUERY doFileSearch(db,organism,cart,tdbList); printf("<BR>\n"); webEnd(); } -char *excludeVars[] = { "submit", "Submit", "g", "ajax", FILE_SEARCH,TRACK_SEARCH_ADD_ROW,TRACK_SEARCH_DEL_ROW}; // HOW IS 'ajax" going to be supported? +char *excludeVars[] = { "submit", "Submit", "g", "ajax", "clearCache", FILE_SEARCH,TRACK_SEARCH_ADD_ROW,TRACK_SEARCH_DEL_ROW}; // HOW IS 'ajax" going to be supported? int main(int argc, char *argv[]) /* Process command line. */ { cgiSpoof(&argc, argv); htmlSetBackground(hBackgroundImage()); cartEmptyShell(doMiddle, hUserCookie(), excludeVars, NULL); return 0; } // TODO: // 1) Done: Limit to first 1000 // 2) Work out simple verses advanced tabs // 3) work out support for non-encode downloads // 4) Make an hgTrackSearch to replace hgTracks track search ?? Simlpler code, but may not be good idea because of composite reshaping in cart vars