13327: More efficient implementation of the filterResources method
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 16 Sep 2024 16:09:06 +0000 (12:09 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 24 Sep 2024 19:23:16 +0000 (15:23 -0400)
commit0840f55a10080781482bd0e9fe78fa9ce05e7764
tree78f42eecf14a5f9f439c8819cd1fe679f9684304
parent7550bf4d297c4e56daa3e9586e0b2c89777484fd
13327: More efficient implementation of the filterResources method

Firefox's built-in javascript profiler indicated that this one method
was accounted for something like 30% of the runtime to load a new page
of results.  (i.e. if it took 1 second to go to the next page, this
accounted for 0.3s of that).

The previous implementation was in a functional programming style that
was egregiously inefficient, by using a reducer that made a copy of
the entire array for every item added to it.

Replaced with a basic imperative implementation that minimizes
redundant copies.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>
services/workbench2/src/store/resources/resources.ts