-
Notifications
You must be signed in to change notification settings - Fork 24.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
Improve performance of performance.clearMarks
#45122
![:octocat: :octocat:](https://github.githubassets.com/images/icons/emoji/octocat.png)
Comments
cc @robik :) |
@rubennorte Should the refactor keep the API compatibility? |
Yes, that's would be preferred for now. I think we could use a better API but for the sake of keeping the changes scoped we should address this first. |
![:octocat: :octocat:](https://github.githubassets.com/images/icons/emoji/octocat.png)
@rubennorte I managed to refactor this, but not sure how to enable it so I can test it properly 😅 Would simply adding the turbomodule be sufficient? |
Yeah, that should suffice. You can include it in |
![:octocat: :octocat:](https://github.githubassets.com/images/icons/emoji/octocat.png)
Description
We have a gated implementation of a new
Performance
API (via the globalperformance
object) andPerformanceObserver
.In this implementation (see
PerformanceEntryReporter
), all performance entries are stored in fixed size circular buffers, which has several problems:performance.clearMarks
is currently anO(n)
operation when given a specific entry name.The second problem is especially relevant in a pattern commonly used to mark points/measures for profiling in the Performance tab without keeping the data in memory for performance observer:
performance.mark
is currentlyO(1)
butperformance.clearMark
isO(n)
(beingn
the number of entries in the buffer), which makes this operation very slow.We should refactor the implementation to:
marks
andmeasures
. We should keep the circular buffer forevent
types, and reduce its size to 150 (as per the spec).React Native Version
0.74.2 / main
Affected Platforms
Runtime - Android, Runtime - iOS, Runtime - Web, Runtime - Desktop
Areas
Bridgeless - The New Initialization Flow, Other (please specify)
Web Convergence
The text was updated successfully, but these errors were encountered: