ad2feb8806432f7fda8aadd119dcb7138acf78ba galt Thu Mar 3 17:22:22 2016 -0800 Adding description requested by Angie. diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index ca571e3..40f6534 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -7315,31 +7315,45 @@ subtrack->nextWindow = subcopy; } } slReverse(©->subtracks); } } slReverse(&newTrackList); trackList = newTrackList; window->next->trackList = trackList; // save new track list in window } trackList = windows->trackList; // restore original track list // Loop over each window loading all tracks trackLoadingInProgress = TRUE; -// TEMP HACK GALT REMOVE +// LOAD OPTIMIZATION HACK GALT +// This is an attempt to try to optimize loading by having multiple regions +// treated as a single span. The hack just grabs the dimensions of the first and last windows +// and uses the loader in the first window to load them, then copies the results to all tracks. +// This basically has only been tried on BED-like tracks, and only for exon/gene-mostly vmodes. +// I am not re-partitioning the results after the load, so this means all windows see all items. +// The reason that tends to work is that by luck most BED handlers have code to check if the item +// overlaps the current window and to skip it if it does not. +// I do not expect something so simple would work with wigs and other track types. +// Even if we do want to optimize the BED-like tracks (which are already the fastest loading type), +// to handle all of the virtmodes properly, this would have be be done differently. +// Instead of just lumping them all into a single range, you would have to cluster together +// ranges that are close together and on the same chromosome. +// Clearly this was just to test an idea for optimizing. +// NOT FINISHED. bool loadHack = FALSE; //TRUE; // probably should only be tried on non-wiggle tracks //warn ("loadHack = %d", loadHack); // TODO int lastWinEnd = 0; for (window=windows; window; window=window->next) lastWinEnd = window->winEnd; for (window=windows; window; window=window->next) { trackList = window->trackList; // set track list setGlobalsFromWindow(window); // TEMP HACK GALT REMOVE if (loadHack) { if (currentWindow == windows) // first window