Skip to content

Commit

Permalink
Merge pull request Expensify#10156 from Expensify/marcaaron-fixBadTra…
Browse files Browse the repository at this point in the history
…ceDestructuring

[No QA] Fix bad performance trace destructuring on Android
  • Loading branch information
srikarparsi authored Jul 29, 2022
2 parents a3859da + bf6ce1c commit a06358c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/Firebase/index.native.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-unused-vars */
import perf from '@react-native-firebase/perf';
import lodashGet from 'lodash/get';
import * as Environment from '../Environment/Environment';
import Log from '../Log';

Expand Down Expand Up @@ -32,19 +33,19 @@ function startTrace(customEventName) {
*/
function stopTrace(customEventName) {
const stop = global.performance.now();

if (Environment.isDevelopment()) {
return;
}

const {trace, start} = traceMap[customEventName];
const trace = lodashGet(traceMap, [customEventName, 'trace']);
if (!trace) {
return;
}

trace.stop();

// Uncomment to inspect logs on release builds
// const start = lodashGet(traceMap, [customEventName, 'start']);
// Log.info(`sidebar_loaded: ${stop - start} ms`, true);

delete traceMap[customEventName];
Expand Down

0 comments on commit a06358c

Please sign in to comment.