samvera / browse-everything

Rails engine providing access to files in cloud storage
Apache License 2.0
114 stars 22 forks source link

Speed up file selection by avoiding unnecessary DOM interaction #380

Closed jrgriffiniii closed 2 years ago

jrgriffiniii commented 2 years ago

This rebases and deprecates #375 (which @dlpierce alone authored):

Opening and selecting directories containing 1000s of files is slow due to excessive interaction with the DOM. This tracks which files are selected in a map and only appends the resulting input objects when the browse everything dialog is submitted.

Some performance numbers: Previously, simply checking the Select All box on an already expanded file system directory containing 12000 files would take close to 10 minutes to complete. This now completes in about 5 seconds, and then submitting the form takes 30s. (There could be further optimization here.)

Additionally, this also temporarily disables the Turbolinks test suite blocking the merging of pull requests.