forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use push model for JS trace provider
Summary: Right now the JS trace provider uses a pull model. Specifically, every 50ms, it asks the Hermes profiler to collect the stack trace from the JS thread and write them into loom entries. The problem is that this process needs to interupt the JS thread by holding a lock, and that causes race conditions with garbage collection. This diff changes it to use pull model. Specifically, the Hermes profiler itself already have a timerLoop which proves to work well, that timerLoop collects the stack traces every N milliseconds, we can just write the stack traces into loom after that. This model makes more sense. Here is a summary for each diff on the stack 1. Add the new API where the sampling profiler will call 2. Remove the timer loop in FBLoomJSTraceProvider, and instead set a callback for write stack to loom. 3. Let sampling profiler call the API added in step 1 4. Clean up the old code path Reviewed By: jpporto Differential Revision: D40944677 fbshipit-source-id: 5bab67a45797d673fc5403e73cfca83e66594b69
- Loading branch information
1 parent
f711f8e
commit b3bf3b3
Showing
2 changed files
with
0 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters