-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NoQA] fix: timing measurements are inaccurate #48654
[NoQA] fix: timing measurements are inaccurate #48654
Conversation
src/libs/actions/Timing.ts
Outdated
|
||
const eventTime = performance.now() - startTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB: Is it better not to count Firebase.startTrace(eventName)
and Firebase.stopTrace(eventName)
in the eventTime? Though both of them look lightweight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, good point - for Firebase.startTrace its already the case, I changed it to be also the case for stopTrace!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for Firebase.startTrace its already the case
Hmm, but we should get startTime
after Firebase.startTrace right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that makes sense as well! I think now we got it 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah sorry i think i committed to the wrong branch, one sec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, now
Reviewer Checklist
Screenshots/VideosAndroid: Native0-android.mp4Android: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We did not find an internal engineer to review this PR, trying to assign a random engineer to #48653 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
FYI we started seeing App crashes after this PR was merged. I'm preventing the crash by making the changes here, but that doesn't fix the root cause in which |
@hannojg This PR has been reverted for causing crashes. Would you like to take a look into that? |
Sorry, was OOO, but now I am back. Yes, let me make a fix for the root cause! |
Actually after looking more closely into this i think the fix @luacmartins deployed is good! |
@luacmartins May I know am I eligible for payment for reviewing this PR? This one is special
That said, whatever the team think is best works for me, thanks. cc @marcaaron |
@eh2077 I reopened the issue to process payment. Thanks for bringing this up. |
Details
I noticed that we postpone ending our timing measurements only when the
getEnvironment()
promise resolves.I had a case where I manually measured that a function only takes 0.17ms, but the timing library was printing in the logs it would take 17ms.
After changing to a more high precision timer using
performance.now()
instead ofDate.now()
and moving the end of the timer mark out of the promise I started to see correct performance measurement values.Fixed Issues
$ #48653
PROPOSAL:
Tests
Make sure that in the console you still see the
[TIMING]
logs.Offline tests
Same as tests
QA Steps
Make sure that in the console you still see the
[TIMING]
logs.PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24
Android: mWeb Chrome
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24
iOS: Native
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24
iOS: mWeb Safari
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24
MacOS: Chrome / Safari
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24
MacOS: Desktop
(Note: as this is internal dev tooling changes, I skipped recording tests for every platform)
https://github.com/user-attachments/assets/07c99888-aced-4d41-a63c-130886f4af24