jbrowse-components icon indicating copy to clipboard operation
jbrowse-components copied to clipboard

Avoid getFeatures refetch for some re-rendering operations

Open cmdcolin opened this issue 1 year ago • 3 comments
trafficstars

This is a challenge with our RPC architecture. In some ways points away from using RPC for rendering. If we change the height of e.g. the SNPCoverage track, it performs a full re-render that includes re-fetching all the features via getFeatures. It also does not abort properly it seems like. Aborting may be some measure of improvement, but the true improvement I think is to skip the re-getFeatures operation entirely.

If you imagined that the "rendering" component only had a e.g. useEffect to fetch the features, and then also did drawing code in the main thread in a separate useEffect, then the drawing code would only react to the track height changing by redrawing, not by refetching the features.

In order to achive a similar behavior for the above, we would need to establish a clause of what requires re-fetching features (similar to a useEffect dependency array). This might be possible with RPC, but an alternative approach would be to remove RPC for rendering.

cmdcolin avatar Nov 22 '23 16:11 cmdcolin

linked issue #1730

cmdcolin avatar Nov 22 '23 16:11 cmdcolin

example of specific technical component of this issue: any change to renderProps requires re-fetching through getFeatures

cmdcolin avatar Nov 22 '23 16:11 cmdcolin

There are a number of optimization related issues for this when RNA-seq is concerned. @carolinebridge-oicr sent some sample data that is deep iso-seq style RNA-seq and it really slows down even for relatively small amount of data (3 megabyte bam file)

cmdcolin avatar Dec 05 '23 18:12 cmdcolin

one optimization was added for this which is called the ultralongfeaturescache. it could potentially help, it reduces re-calculating the mismatches datastructure. this is a tough issue though is is on of those HOURS_WASTED_HERE++ type things when you get into the code. still high impact though

cmdcolin avatar Nov 27 '24 01:11 cmdcolin