engaging-computing / rSENSE

A data aggregation and visualization tool for classroom science
10 stars 48 forks source link

Table Vis takes a long time to load on projects with lots of data and many fields #2411

Closed pat-son closed 8 years ago

pat-son commented 8 years ago

General description: Trying to open the Table Vis on a project that has many fields and many datapoints takes much longer than opening any other vis. Not even limiting the number of visible fields helps. Edit: Actually, showing more fields makes the page load faster.

live/dev/localhost: All 3 iSENSE Version: 8.0.2 Logged in (Y or N): Either Admin (Y or N): Either

OS: Any Browser/Version: Any

Steps to Reproduce: Open the visualization for the Plinko Project, which has 3 fields and 1159 datapoints (careful of the extant URL bug). Open the table vis. Note how quickly it opens. Now, go to the visualization for the Winter Weather Data project, which has only 161 datapoints but 23 fields, and open the table vis. Note how slowly it opens, despite having less data that the Plinko Project.

pat-son commented 8 years ago

The culprit seems to be this loop in table.coffee, based on my very scientific tests: image Edit: After more testing, the issue lies within this line of code: @table.hideCol(col.name) For whatever reason, this function takes a very long time to run (80 - 120 ms), which really adds up when you're hiding 22 of the 30 fields.

pat-son commented 8 years ago

Testers: Make sure that everything is working as it was before, just faster. A good project to test the improved speed is Winter Weather Data (compare the dev (patched) version to the live version).

pat-son commented 8 years ago

PASSED testing on Chrome 50.0.2661.102 (Ubuntu 16.04). woah, so fast