Closed Bug 1585497 Opened 6 years ago Closed 6 years ago

Memoize inline preview per call stack item

Categories

(DevTools :: Debugger, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1585515

People

(Reporter: davidwalsh, Assigned: davidwalsh)

Details

Consider: with inline preview on and the following change...

diff --git a/devtools/client/debugger/src/actions/pause/inlinePreview.js b/devtools/client/debugger/src/actions/pause/inlinePreview.js
--- a/devtools/client/debugger/src/actions/pause/inlinePreview.js
+++ b/devtools/client/debugger/src/actions/pause/inlinePreview.js
@@ -27,6 +27,9 @@ function getLocalScopeLevels(originalAst
 
 export function generateInlinePreview(cx: ThreadContext, frame: ?Frame) {
   return async function({ dispatch, getState, parser, client }: ThunkArgs) {
+
+    console.log("Getting inline previews!");
+
     if (!frame || !features.inlinePreview) {
       return;
     }
@@ -128,7 +131,6 @@ function getBindingValues(
   properties: Array<Object> | null
 ): Previews {
   const previews: Previews = {};
   const binding =
     originalAstScopes[curLevel] && originalAstScopes[curLevel].bindings[name];
   if (!binding) {

When paused, you can continually click the same function in the Call Stack panel and the inline preview is fetched over and over again.

We should try to memoize the result of generateInlinePreview to prevent the need for this.

Summary: Memoize inline preview per frame → Memoize inline preview per call stack item
Assignee: nobody → dwalsh
Status: NEW → ASSIGNED
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.