Skip to content
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

[Turbopack] improve memory measurement suite #66748

Merged
merged 7 commits into from
Jun 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup
  • Loading branch information
sokra committed Jun 15, 2024
commit edb157ed174c2304ca8a0aab075c1f995737a3dd
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-build-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ turbopack-binding = { workspace = true, features = [
"__turbo_tasks_env",
"__turbo_tasks_fs",
"__turbo_tasks_memory",
"__turbo_tasks_malloc",
"__turbopack",
"__turbopack_nodejs",
"__turbopack_core",
Expand Down
10 changes: 5 additions & 5 deletions packages/next-swc/crates/next-build-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ pub async fn main_inner(

// filter out the files that are not in the list
// we expect this to be small so linear search OK
Box::new(
Box::new(files.into_iter().filter_map(|f| {
entrypoints
.routes
.clone()
.into_iter()
.filter(move |(name, _)| files.iter().any(|f| f.as_str() == name.as_str())),
) as Box<dyn Iterator<Item = _> + Send + Sync>
.iter()
.find(|(name, _)| f.as_str() == name.as_str())
.map(|(name, route)| (name.clone(), route.clone()))
})) as Box<dyn Iterator<Item = _> + Send + Sync>
} else {
Box::new(shuffle(entrypoints.routes.clone().into_iter()))
};
Expand Down
4 changes: 1 addition & 3 deletions packages/next-swc/crates/next-build-test/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::{convert::Infallible, str::FromStr, time::Instant};
use next_api::project::{DefineEnv, ProjectOptions};
use next_build_test::{main_inner, Strategy};
use turbo_tasks::TurboTasks;
use turbo_tasks_malloc::TurboMalloc;
use turbopack_binding::turbo::tasks_memory::MemoryBackend;
use turbopack_binding::turbo::{malloc::TurboMalloc, tasks_memory::MemoryBackend};

#[global_allocator]
static ALLOC: TurboMalloc = TurboMalloc;
Expand Down Expand Up @@ -70,7 +69,6 @@ fn main() {
.build()
.unwrap()
.block_on(async {
tracing::info!("start");
let tt = TurboTasks::new(MemoryBackend::new(usize::MAX));
let result = main_inner(&tt, strat, factor, limit, files).await;
let memory = TurboMalloc::memory_usage();
Expand Down