berman-lab / ymap

YMAP - Yeast Mapping Analysis Pipeline : An online pipeline for the analysis of yeast genomic datasets.
MIT License
6 stars 6 forks source link

Visualizing a dataset for the first time freezes UI for a few seconds #1

Closed vladimirg closed 9 years ago

vladimirg commented 9 years ago

This happens in two places:

  1. Simply selecting a dataset to visualize.
  2. When opening the Ymap website for the firs time, it will sometimes also load visualizations of datasets (which also freezes for a while).

The cause may be (quoted from prior correspondence):

My initial investigation with Safari’s Timelines shows that 7+ seconds are spent in panel.visualizeDataset.php:14, in the Javascript call parent.openProject('default','Fig_02A.YQ2_raw','0_sys','null','null','Fig_02A.YQ2_raw’). I then stepped through it with a debugger and saw that isFile takes a noticeable amount of time, and is called often. Within isFile there is method ‘send’, which I’m guessing performs a network call to the server. This is costly, and is done often, and is synchronous (making the browser wait, and the UI freeze). So it looks like a good place to start.

darrenabbey commented 9 years ago

I suspect the delays in loading is due to the isFile javascript function. It tests for the existence of a file over the http protocol, which relies on waiting for a timeout... which when done a few times in series, results in obvious delays.

The way around this would be to have the interface load a specified text file for each project that would contain the list of valid figure images. The javascript would then use this list to determine what user interface elements should be presented. This will remove the delay caused by the request-timeout cycle of the isfile function.

darrenabbey commented 9 years ago

An alternate is for the javascript to load a server-side PHP script that will then return a list of usable files for processing into user elements by the javascript.

vladimirg commented 9 years ago

@darrenabbey, sounds good - I'll encode all relevant files as a JavaScript list in panel.visualizeDataset.php:84, so that list can be used in index.php instead of the isFile calls.