Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
75c35c55
Commit
75c35c55
authored
Jan 30, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: try to improve trace viewer
parent
229b28e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
6 deletions
+24
-6
mod.rs
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
+3
-1
span_graph_ref.rs
...opack/crates/turbopack-trace-server/src/span_graph_ref.rs
+10
-3
span_ref.rs
turbopack/crates/turbopack-trace-server/src/span_ref.rs
+11
-2
No files found.
turbopack/crates/turbopack-ecmascript/src/references/mod.rs
View file @
75c35c55
...
...
@@ -738,7 +738,9 @@ pub(crate) async fn analyse_ecmascript_module_internal(
let
handler
=
Handler
::
with_emitter
(
true
,
false
,
Box
::
new
(
emitter
));
let
mut
var_graph
=
{
let
_span
=
tracing
::
info_span!
(
"analyze variable values"
);
// This span messes with persistent caching because the resulting effects are freed in a
// different span
// let _span = tracing::info_span!("analyze variable values").entered();
set_handler_and_globals
(
&
handler
,
globals
,
||
create_graph
(
program
,
eval_context
))
};
...
...
turbopack/crates/turbopack-trace-server/src/span_graph_ref.rs
View file @
75c35c55
...
...
@@ -215,10 +215,17 @@ impl<'a> SpanGraphRef<'a> {
pub
fn
self_persistent_allocations
(
&
self
)
->
u64
{
*
self
.graph.self_persistent_allocations
.get_or_init
(||
{
self
.recursive_spans
()
.map
(|
span
|
span
.self_persistent_allocations
())
let
expected_total
=
self
.total_allocations
()
.saturating_sub
(
self
.total_deallocations
());
let
child_total
=
self
.children
()
.map
(|
graph
|
graph
.total_persistent_allocations
())
.reduce
(|
a
,
b
|
a
+
b
)
.unwrap_or_default
()
.unwrap_or_default
();
expected_total
.saturating_sub
(
child_total
)
})
}
...
...
turbopack/crates/turbopack-trace-server/src/span_ref.rs
View file @
75c35c55
...
...
@@ -153,8 +153,17 @@ impl<'a> SpanRef<'a> {
}
pub
fn
self_persistent_allocations
(
&
self
)
->
u64
{
self
.self_allocations
()
.saturating_sub
(
self
.span.self_deallocations
)
let
expected_total
=
self
.total_allocations
()
.saturating_sub
(
self
.total_deallocations
());
let
child_total
=
self
.children
()
.map
(|
child
|
child
.total_persistent_allocations
())
.reduce
(|
a
,
b
|
a
+
b
)
.unwrap_or_default
();
expected_total
.saturating_sub
(
child_total
)
}
pub
fn
self_allocation_count
(
&
self
)
->
u64
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment