Skip to content

Commit 29ba787

Browse files
committed
Update opt-trace-format.md
1 parent 6edc79d commit 29ba787

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎v3/docs/opt-trace-format.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ The `event` field can either be:
753753

754754
## Closures and Zombie Frames (advanced)
755755

756-
As soon as a funcition becomes a parent of another function (i.e., a nested function is defined inside of it), then set the `is_parent` field of its stack entry to `true`. Also change its `unique_hash` by appending `_p` to the end of it. The reason why we want to change the unique hash is that we want the frontend to *refresh* its display, and d3 might not refresh if it sees that the hash is identical to the prior frame. Conceptually, we want `unique_hash` to be different for a function before and after it turns into the parent of another function since we want to display it differently.
756+
As soon as a function becomes the parent of another function (i.e., a nested function is defined inside of it), then set the `is_parent` field of its stack entry to `true`. Also change its `unique_hash` by appending `_p` to it. The reason why we want to change `unique_hash` is that we want the frontend to *refresh* its display, and d3 might not refresh if it sees that the hash is identical to the prior frame. Conceptually, we want `unique_hash` to be different for a function before and after it turns into the parent of another function since we want to display it differently.
757757

758758
For example, when function `foo` is executing, its frame will have `is_parent` set to `false` when its first two lines execute. Then when its third line executes, that defines `bar` as a nested function within itself, so at that step, `foo` should have `is_parent = true` and `unique_hash = foo_f1_p` (or something similar).
759759

0 commit comments

Comments
 (0)