Bug 1576318 Part 3 - Avoid rerendering messages when the paused execution point has not changed, r=loganfsmyth,nchevobbe.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 30 Aug 2019 17:07:07 +0000
changeset 554664 607ed403709d8706e9328c438d16cb90add0ebd3
parent 554663 19ab89cb9468e44c27385c5dae3959f6f46d7391
child 554665 aa75f0814cbe0364bfd545cea8be68e226cb09e0
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersloganfsmyth, nchevobbe
bugs1576318
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1576318 Part 3 - Avoid rerendering messages when the paused execution point has not changed, r=loganfsmyth,nchevobbe. Depends on D43319 Differential Revision: https://phabricator.services.mozilla.com/D43320
devtools/client/webconsole/actions/messages.js
devtools/client/webconsole/constants.js
devtools/client/webconsole/reducers/messages.js
--- a/devtools/client/webconsole/actions/messages.js
+++ b/devtools/client/webconsole/actions/messages.js
@@ -17,17 +17,17 @@ const {
   NETWORK_MESSAGE_UPDATE,
   NETWORK_UPDATE_REQUEST,
   MESSAGES_CLEAR,
   MESSAGES_CLEAR_LOGPOINT,
   MESSAGE_OPEN,
   MESSAGE_CLOSE,
   MESSAGE_TYPE,
   MESSAGE_UPDATE_PAYLOAD,
-  PAUSED_EXCECUTION_POINT,
+  PAUSED_EXECUTION_POINT,
   PRIVATE_MESSAGES_CLEAR,
 } = require("../constants");
 
 const defaultIdGenerator = new IdGenerator();
 
 function messagesAdd(packets, idGenerator = null) {
   if (idGenerator == null) {
     idGenerator = defaultIdGenerator;
@@ -63,17 +63,17 @@ function messagesClearLogpoint(logpointI
   return {
     type: MESSAGES_CLEAR_LOGPOINT,
     logpointId,
   };
 }
 
 function setPauseExecutionPoint(executionPoint) {
   return {
-    type: PAUSED_EXCECUTION_POINT,
+    type: PAUSED_EXECUTION_POINT,
     executionPoint,
   };
 }
 
 function privateMessagesClear() {
   return {
     type: PRIVATE_MESSAGES_CLEAR,
   };
--- a/devtools/client/webconsole/constants.js
+++ b/devtools/client/webconsole/constants.js
@@ -39,17 +39,17 @@ const actionTypes = {
   SHOW_CONTENT_MESSAGES_TOGGLE: "SHOW_CONTENT_MESSAGES_TOGGLE",
   SIDEBAR_CLOSE: "SIDEBAR_CLOSE",
   SPLIT_CONSOLE_CLOSE_BUTTON_TOGGLE: "SPLIT_CONSOLE_CLOSE_BUTTON_TOGGLE",
   TIMESTAMPS_TOGGLE: "TIMESTAMPS_TOGGLE",
   UPDATE_HISTORY_POSITION: "UPDATE_HISTORY_POSITION",
   REVERSE_SEARCH_INPUT_CHANGE: "REVERSE_SEARCH_INPUT_CHANGE",
   REVERSE_SEARCH_NEXT: "REVERSE_SEARCH_NEXT",
   REVERSE_SEARCH_BACK: "REVERSE_SEARCH_BACK",
-  PAUSED_EXCECUTION_POINT: "PAUSED_EXCECUTION_POINT",
+  PAUSED_EXECUTION_POINT: "PAUSED_EXECUTION_POINT",
   WARNING_GROUPS_TOGGLE: "WARNING_GROUPS_TOGGLE",
   WILL_NAVIGATE: "WILL_NAVIGATE",
   EDITOR_SET_WIDTH: "EDITOR_SET_WIDTH",
 };
 
 const prefs = {
   PREFS: {
     // Filter preferences only have the suffix since they can be used either for the
--- a/devtools/client/webconsole/reducers/messages.js
+++ b/devtools/client/webconsole/reducers/messages.js
@@ -370,17 +370,24 @@ function messages(
     groupsById,
     visibleMessages,
   } = state;
 
   const { logLimit } = prefsState;
 
   let newState;
   switch (action.type) {
-    case constants.PAUSED_EXCECUTION_POINT:
+    case constants.PAUSED_EXECUTION_POINT:
+      if (
+        state.pausedExecutionPoint &&
+        action.executionPoint &&
+        pointEquals(state.pausedExecutionPoint, action.executionPoint)
+      ) {
+        return state;
+      }
       return { ...state, pausedExecutionPoint: action.executionPoint };
     case constants.MESSAGES_ADD:
       // Preemptively remove messages that will never be rendered
       const list = [];
       let prunableCount = 0;
       let lastMessageRepeatId = -1;
       for (let i = action.messages.length - 1; i >= 0; i--) {
         const message = action.messages[i];