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
6c632b81
Commit
6c632b81
authored
Jan 24, 2025
by
Tobias Koppers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup
parent
6a2e6c25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
35 deletions
+24
-35
dynamic_storage.rs
...crates/turbo-tasks-backend/src/backend/dynamic_storage.rs
+10
-2
mod.rs
turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
+1
-6
storage.rs
turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
+13
-27
No files found.
turbopack/crates/turbo-tasks-backend/src/backend/dynamic_storage.rs
View file @
6c632b81
...
@@ -110,11 +110,19 @@ impl DynamicStorage {
...
@@ -110,11 +110,19 @@ impl DynamicStorage {
}
}
pub
fn
size
(
&
self
)
->
usize
{
pub
fn
size
(
&
self
)
->
usize
{
self
.map
.iter
()
.map
(|
m
|
m
.size
())
.sum
()
self
.map
.iter
()
.map
(|
m
|
m
.size
())
.sum
::
<
usize
>
()
+
self
.map
.len
()
*
size_of
::
<
CachedDataItemStorage
>
()
}
pub
fn
size_of_type
(
&
self
,
ty
:
CachedDataItemType
)
->
usize
{
self
.get_map
(
ty
)
.map
(|
m
|
m
.size
()
+
size_of
::
<
CachedDataItemStorage
>
())
.unwrap_or_default
()
}
}
pub
fn
capacity_size
(
&
self
)
->
usize
{
pub
fn
capacity_size
(
&
self
)
->
usize
{
self
.map
.iter
()
.map
(|
m
|
m
.capacity_size
())
.sum
()
self
.map
.iter
()
.map
(|
m
|
m
.capacity_size
())
.sum
::
<
usize
>
()
+
self
.map
.capacity
()
*
size_of
::
<
CachedDataItemStorage
>
()
}
}
pub
fn
iter
(
pub
fn
iter
(
...
...
turbopack/crates/turbo-tasks-backend/src/backend/mod.rs
View file @
6c632b81
...
@@ -827,18 +827,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
...
@@ -827,18 +827,13 @@ impl<B: BackingStorage> TurboTasksBackendInner<B> {
let
size
=
self
.storage
.size
();
let
size
=
self
.storage
.size
();
let
capacity
=
self
.storage
.capacity_size
();
let
capacity
=
self
.storage
.capacity_size
();
let
tasks
=
self
.storage
.tasks
();
let
tasks
=
self
.storage
.tasks
();
let
storages_len
=
self
.storage
.storages_len
();
let
storages_capacity
=
self
.storage
.storages_capacity
();
let
data_len
=
self
.storage
.data_len
();
let
data_len
=
self
.storage
.data_len
();
let
data_capacity
=
self
.storage
.data_capacity
();
let
data_capacity
=
self
.storage
.data_capacity
();
println!
(
println!
(
"Storage size {}MiB, capactiy {}MiB, {} tasks
\n
Storages {}M, capacity {}M, Data
\
"Storage size {}MiB, capactiy {}MiB, {} tasks
\n
Data entries {}M, capacity {}M"
,
entries {}M, capacity {}M"
,
size
/
1024
/
1024
,
size
/
1024
/
1024
,
capacity
/
1024
/
1024
,
capacity
/
1024
/
1024
,
tasks
,
tasks
,
storages_len
/
1000
/
1000
,
storages_capacity
/
1000
/
1000
,
data_len
/
1000
/
1000
,
data_len
/
1000
/
1000
,
data_capacity
/
1000
/
1000
data_capacity
/
1000
/
1000
);
);
...
...
turbopack/crates/turbo-tasks-backend/src/backend/storage.rs
View file @
6c632b81
...
@@ -150,14 +150,6 @@ impl InnerStorage {
...
@@ -150,14 +150,6 @@ impl InnerStorage {
+
self
.output_dependent
.len
()
+
self
.output_dependent
.len
()
}
}
pub
fn
types
(
&
self
)
->
usize
{
self
.map
.len
()
}
pub
fn
types_capacity
(
&
self
)
->
usize
{
self
.map
.capacity
()
}
pub
fn
capacity
(
&
self
)
->
usize
{
pub
fn
capacity
(
&
self
)
->
usize
{
use
crate
::
data_storage
::
Storage
;
use
crate
::
data_storage
::
Storage
;
self
.dynamic
.capacity
()
self
.dynamic
.capacity
()
...
@@ -209,10 +201,18 @@ impl InnerStorage {
...
@@ -209,10 +201,18 @@ impl InnerStorage {
}
}
pub
fn
size_by_type
(
&
self
,
sizes
:
&
mut
HashMap
<
CachedDataItemType
,
usize
>
)
{
pub
fn
size_by_type
(
&
self
,
sizes
:
&
mut
HashMap
<
CachedDataItemType
,
usize
>
)
{
for
storage
in
self
.map
.iter
()
{
use
crate
::
data_storage
::
Storage
;
*
sizes
.entry
(
storage
.ty
())
.or_default
()
+=
for
ty
in
self
.dynamic
.types
()
{
storage
.size
()
+
size_of
::
<
CachedDataItemStorage
>
(
);
*
sizes
.entry
(
ty
)
.or_default
()
+=
self
.dynamic
.size_of_type
(
ty
);
}
}
*
sizes
.entry
(
CachedDataItemType
::
AggregationNumber
)
.or_default
()
+=
self
.aggregation_number
.size
();
*
sizes
.entry
(
CachedDataItemType
::
Output
)
.or_default
()
+=
self
.output
.size
();
*
sizes
.entry
(
CachedDataItemType
::
Upper
)
.or_default
()
+=
self
.upper
.size
();
*
sizes
.entry
(
CachedDataItemType
::
OutputDependent
)
.or_default
()
+=
self
.output_dependent
.size
();
}
}
pub
fn
persistance_state
(
&
self
)
->
&
PersistanceState
{
pub
fn
persistance_state
(
&
self
)
->
&
PersistanceState
{
...
@@ -594,26 +594,12 @@ impl Storage {
...
@@ -594,26 +594,12 @@ impl Storage {
.sum
::
<
usize
>
()
.sum
::
<
usize
>
()
}
}
pub
fn
storages_len
(
&
self
)
->
usize
{
self
.map
.iter
()
.map
(|
key_value
|
key_value
.value
()
.types
())
.sum
::
<
usize
>
()
}
pub
fn
storages_capacity
(
&
self
)
->
usize
{
self
.map
.iter
()
.map
(|
key_value
|
key_value
.value
()
.types_capacity
())
.sum
::
<
usize
>
()
}
pub
fn
size
(
&
self
)
->
usize
{
pub
fn
size
(
&
self
)
->
usize
{
self
.map
self
.map
.iter
()
.iter
()
.map
(|
key_value
|
key_value
.value
()
.size
())
.map
(|
key_value
|
key_value
.value
()
.size
())
.sum
::
<
usize
>
()
.sum
::
<
usize
>
()
+
self
.map
.len
()
*
size_of
::
<
(
TaskId
,
InnerStorage
)
>
()
+
self
.map
.len
()
*
size_of
::
<
(
TaskId
,
Box
<
InnerStorage
>
,
InnerStorage
)
>
()
}
}
pub
fn
capacity_size
(
&
self
)
->
usize
{
pub
fn
capacity_size
(
&
self
)
->
usize
{
...
@@ -621,7 +607,7 @@ impl Storage {
...
@@ -621,7 +607,7 @@ impl Storage {
.iter
()
.iter
()
.map
(|
key_value
|
key_value
.value
()
.capacity_size
())
.map
(|
key_value
|
key_value
.value
()
.capacity_size
())
.sum
::
<
usize
>
()
.sum
::
<
usize
>
()
+
self
.map
.capacity
()
*
size_of
::
<
(
TaskId
,
InnerStorage
)
>
()
+
self
.map
.capacity
()
*
size_of
::
<
(
TaskId
,
Box
<
InnerStorage
>
,
InnerStorage
)
>
()
}
}
pub
fn
tasks
(
&
self
)
->
usize
{
pub
fn
tasks
(
&
self
)
->
usize
{
...
...
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