Skip to content

Commit

Permalink
refactor: Tweak how performance is logged (#1353)
Browse files Browse the repository at this point in the history
This splits up the different parts of inventory rebuilding to see which part is taking the most time.
  • Loading branch information
NigelBreslaw authored Apr 21, 2024
1 parent 20a0a5b commit 6ef6583
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions native/app/store/AccountInventoryLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ export function updateAllPages(get: AccountSliceGetter, set: AccountSliceSetter)
index++;
}
});
set({ ggCharacters: updatedGGCharacters });
const p3 = performance.now();
console.log("rebuild UI took:", `${(p3 - p2).toFixed(4)} ms`);
console.log("compare ggCharacters took:", `${(p3 - p2).toFixed(4)} ms`);
set({ ggCharacters: updatedGGCharacters });
const p4 = performance.now();
console.log("rebuild UI took:", `${(p4 - p3).toFixed(4)} ms`);
}

function createUIData(get: AccountSliceGetter) {
Expand Down

0 comments on commit 6ef6583

Please sign in to comment.