appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.78k stars 3.63k forks source link

[Perf]: List widget re-rendering memoization #11620

Closed ashit-rath closed 2 years ago

ashit-rath commented 2 years ago

Is there an existing issue for this?

SubTasks

The getCanvasChildren memoization is not working correctly anymore i.e the equality function always returns false. Right now the only way this works is if we do deep equality on all params.

Works

memoizeOne(fn, deepEqual)

Doesn't work with individual deep equals

memoizeOne(fn, (prev: any, next: any) => {
      // not comparing canvasChildren becuase template acts as a proxy

      return (
        deepEqual(prev[0], next[0]) &&
        deepEqual(prev[1], next[1]) &&
        deepEqual(prev[2], next[2]) &&
        deepEqual(prev[3] === next[3]) &&
        deepEqual(prev[4] === next[4]) &&
        deepEqual(prev[5] === next[6]) &&
        deepEqual(prev[6] === next[6])
      );
    })
dilippitchika commented 2 years ago

@ashit-rath what should be the next steps here? I don't see this assigned to anyone

Tooluloope commented 2 years ago

Picked up after solving the major Derived Property issues with the list widget