Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions crates/node_binding/napi-binding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1397,7 +1397,6 @@ export interface JsStatsModuleCommonAttributes {
failed?: boolean
errors?: number
warnings?: number
profile?: JsStatsModuleProfile
chunks?: Array<string>
assets?: Array<string>
reasons?: Array<JsStatsModuleReason>
Expand Down Expand Up @@ -2598,7 +2597,6 @@ export interface RawOptions {
cache: RawCacheOptions
experiments: RawExperiments
node?: RawNodeOption
profile: boolean
amd?: string
bail: boolean
__references: Record<string, any>
Expand Down
19 changes: 0 additions & 19 deletions crates/rspack/src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@ impl CompilerBuilder {
self
}

/// Set whether to enable profiling.
///
/// See [`CompilerOptionsBuilder::profile`] for more details.
pub fn profile(&mut self, profile: bool) -> &mut Self {
self.options_builder.profile(profile);
self
}

/// Set options for module configuration.
///
/// Both are accepted:
Expand Down Expand Up @@ -584,8 +576,6 @@ pub struct CompilerOptionsBuilder {
resolve_loader: Option<Resolve>,
/// The type of externals.
devtool: Option<Devtool>,
/// The type of externals.
profile: Option<bool>,
/// Whether to fail on the first error.
bail: Option<bool>,
/// Performance optimization options.
Expand Down Expand Up @@ -619,7 +609,6 @@ impl From<&mut CompilerOptionsBuilder> for CompilerOptionsBuilder {
resolve: value.resolve.take(),
resolve_loader: value.resolve_loader.take(),
devtool: value.devtool.take(),
profile: value.profile.take(),
bail: value.bail.take(),
experiments: value.experiments.take(),
module: value.module.take(),
Expand Down Expand Up @@ -723,12 +712,6 @@ impl CompilerOptionsBuilder {
self
}

/// Set whether to enable profiling.
pub fn profile(&mut self, profile: bool) -> &mut Self {
self.profile = Some(profile);
self
}

/// Set options for module configuration.
///
/// Both are accepted:
Expand Down Expand Up @@ -938,7 +921,6 @@ impl CompilerOptionsBuilder {
}
});

let profile = d!(self.profile.take(), false);
let bail = d!(self.bail.take(), false);
let cache = d!(self.cache.take(), {
if development {
Expand Down Expand Up @@ -1271,7 +1253,6 @@ impl CompilerOptionsBuilder {
experiments,
node,
optimization,
profile,
amd,
bail,
__references: Default::default(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,6 @@ CompilerOptions {
avoid_entry_iife: false,
real_content_hash: false,
},
profile: false,
amd: None,
bail: false,
__references: {},
Expand Down
2 changes: 0 additions & 2 deletions crates/rspack_binding_api/src/raw_options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pub struct RawOptions {
pub cache: RawCacheOptions,
pub experiments: RawExperiments,
pub node: Option<RawNodeOption>,
pub profile: bool,
pub amd: Option<String>,
pub bail: bool,
#[napi(js_name = "__references", ts_type = "Record<string, any>")]
Expand Down Expand Up @@ -131,7 +130,6 @@ impl TryFrom<RawOptions> for CompilerOptions {
cache,
optimization,
node,
profile: value.profile,
amd: value.amd,
bail: value.bail,
__references: value.__references,
Expand Down
2 changes: 0 additions & 2 deletions crates/rspack_binding_api/src/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ pub struct JsStatsModuleCommonAttributes<'a> {
pub failed: Option<bool>,
pub errors: Option<u32>,
pub warnings: Option<u32>,
pub profile: Option<JsStatsModuleProfile>,

// ids
pub chunks: Option<Vec<&'a str>>,
Expand Down Expand Up @@ -630,7 +629,6 @@ impl<'a> TryFrom<StatsModule<'a>> for JsStatsModule<'a> {
reasons,
assets: stats.assets,
source,
profile: stats.profile.map(|p| p.into()),
orphan: stats.orphan,
provided_exports: stats.provided_exports.map(AtomVecWrapper::new),
optimization_bailout: stats.optimization_bailout.map(StringSliceWrapper::new),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rspack_error::Result;

use super::{TaskContext, build::BuildTask, lazy::ProcessUnlazyDependenciesTask};
use crate::{
BoxDependency, BoxModule, ModuleIdentifier, ModuleProfile,
BoxDependency, BoxModule, ModuleIdentifier,
compilation::build_module_graph::ForwardedIdSet,
module_graph::{ModuleGraph, ModuleGraphModule},
utils::task_loop::{Task, TaskResult, TaskType},
Expand All @@ -14,7 +14,6 @@ pub struct AddTask {
pub module: BoxModule,
pub module_graph_module: Box<ModuleGraphModule>,
pub dependencies: Vec<BoxDependency>,
pub current_profile: Option<ModuleProfile>,
pub from_unlazy: bool,
}

Expand Down Expand Up @@ -116,7 +115,6 @@ impl Task<TaskContext> for AddTask {
compiler_id: context.compiler_id,
compilation_id: context.compilation_id,
module: self.module,
current_profile: self.current_profile,
resolver_factory: context.resolver_factory.clone(),
compiler_options: context.compiler_options.clone(),
plugin_driver: context.plugin_driver.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{
};
use crate::{
AsyncDependenciesBlock, BoxDependency, BoxModule, BuildContext, BuildResult, CompilationId,
CompilerId, CompilerOptions, DependencyParents, ModuleProfile, ResolverFactory, RuntimeTemplate,
CompilerId, CompilerOptions, DependencyParents, ResolverFactory, RuntimeTemplate,
SharedPluginDriver,
compilation::build_module_graph::{ForwardedIdSet, HasLazyDependencies, LazyDependencies},
utils::{
Expand All @@ -22,7 +22,6 @@ pub struct BuildTask {
pub compiler_id: CompilerId,
pub compilation_id: CompilationId,
pub module: BoxModule,
pub current_profile: Option<ModuleProfile>,
pub resolver_factory: Arc<ResolverFactory>,
pub compiler_options: Arc<CompilerOptions>,
pub runtime_template: Arc<RuntimeTemplate>,
Expand All @@ -44,14 +43,10 @@ impl Task<TaskContext> for BuildTask {
resolver_factory,
plugin_driver,
runtime_template,
mut current_profile,
mut module,
fs,
forwarded_ids,
} = *self;
if let Some(current_profile) = &mut current_profile {
current_profile.mark_building_start();
}

plugin_driver
.compilation_hooks
Expand All @@ -74,16 +69,11 @@ impl Task<TaskContext> for BuildTask {
)
.await;

if let Some(current_profile) = &mut current_profile {
current_profile.mark_building_end();
}

result.map::<Vec<Box<dyn Task<TaskContext>>>, _>(|build_result| {
vec![Box::new(BuildResultTask {
module,
build_result: Box::new(build_result),
plugin_driver,
current_profile,
forwarded_ids,
})]
})
Expand All @@ -95,7 +85,6 @@ struct BuildResultTask {
pub module: BoxModule,
pub build_result: Box<BuildResult>,
pub plugin_driver: SharedPluginDriver,
pub current_profile: Option<ModuleProfile>,
pub forwarded_ids: ForwardedIdSet,
}

Expand All @@ -108,7 +97,6 @@ impl Task<TaskContext> for BuildResultTask {
let BuildResultTask {
mut module,
build_result,
current_profile,
plugin_driver,
mut forwarded_ids,
} = *self;
Expand Down Expand Up @@ -199,9 +187,6 @@ impl Task<TaskContext> for BuildResultTask {
{
let mgm = module_graph.module_graph_module_by_identifier_mut(&module.identifier());
mgm.all_dependencies = all_dependencies.clone();
if let Some(current_profile) = current_profile {
mgm.set_profile(current_profile);
}
}

let module_identifier = module.identifier();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::{TaskContext, add::AddTask};
use crate::{
BoxDependency, CompilationId, CompilerId, CompilerOptions, Context, ExportsInfoData,
FactorizeInfo, ModuleFactory, ModuleFactoryCreateData, ModuleFactoryResult, ModuleIdentifier,
ModuleLayer, ModuleProfile, Resolve, ResolverFactory,
ModuleLayer, Resolve, ResolverFactory,
module_graph::ModuleGraphModule,
utils::{
ResourceId,
Expand All @@ -28,7 +28,6 @@ pub struct FactorizeTask {
pub dependencies: Vec<BoxDependency>,
pub resolve_options: Option<Arc<Resolve>>,
pub options: Arc<CompilerOptions>,
pub current_profile: Option<ModuleProfile>,
pub resolver_factory: Arc<ResolverFactory>,
pub from_unlazy: bool,
}
Expand All @@ -39,9 +38,6 @@ impl Task<TaskContext> for FactorizeTask {
TaskType::Background
}
async fn background_run(mut self: Box<Self>) -> TaskResult<TaskContext> {
if let Some(current_profile) = &mut self.current_profile {
current_profile.mark_factory_start();
}
let dependency = &self.dependencies[0];

let context = if let Some(context) = dependency.get_context()
Expand Down Expand Up @@ -113,10 +109,6 @@ impl Task<TaskContext> for FactorizeTask {
}
};

if let Some(current_profile) = &mut self.current_profile {
current_profile.mark_factory_end();
}

let factorize_info = if let Some(unsafe_cache_predicate) = &self.options.module.unsafe_cache
&& let Some(result) = &factory_result
&& let Some(module) = &result.module
Expand Down Expand Up @@ -151,7 +143,6 @@ impl Task<TaskContext> for FactorizeTask {
original_module_identifier: self.original_module_identifier,
factory_result,
dependencies: create_data.dependencies,
current_profile: self.current_profile,
exports_info_related: exports_info,
factorize_info,
from_unlazy: self.from_unlazy,
Expand All @@ -166,7 +157,6 @@ pub struct FactorizeResultTask {
/// Result will be available if [crate::ModuleFactory::create] returns `Ok`.
pub factory_result: Option<ModuleFactoryResult>,
pub dependencies: Vec<BoxDependency>,
pub current_profile: Option<ModuleProfile>,
pub exports_info_related: ExportsInfoData,
pub factorize_info: FactorizeInfo,
pub from_unlazy: bool,
Expand All @@ -182,7 +172,6 @@ impl Task<TaskContext> for FactorizeResultTask {
original_module_identifier,
factory_result,
mut dependencies,
current_profile,
exports_info_related,
mut factorize_info,
from_unlazy,
Expand Down Expand Up @@ -253,7 +242,6 @@ impl Task<TaskContext> for FactorizeResultTask {
module,
module_graph_module: Box::new(mgm),
dependencies,
current_profile,
from_unlazy,
})])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rustc_hash::{FxHashMap as HashMap, FxHashSet as HashSet};
use self::context::TaskContext;
use super::BuildModuleGraphArtifact;
use crate::{
BuildDependency, Compilation, ModuleProfile,
BuildDependency, Compilation,
utils::task_loop::{Task, run_task_loop},
};

Expand Down Expand Up @@ -43,7 +43,6 @@ pub async fn repair(
.into_iter()
.map(|dep_id| {
let dependency = module_graph.dependency_by_id(&dep_id);
let current_profile = compilation.options.profile.then(ModuleProfile::default);
Box::new(factorize::FactorizeTask {
compiler_id: compilation.compiler_id(),
compilation_id: compilation.id(),
Expand All @@ -56,7 +55,6 @@ pub async fn repair(
dependencies: vec![dependency.clone()],
resolve_options: None,
options: compilation.options.clone(),
current_profile,
resolver_factory: compilation.resolver_factory.clone(),
from_unlazy: false,
}) as Box<dyn Task<TaskContext>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_hash::FxHashMap as HashMap;

use super::{TaskContext, factorize::FactorizeTask};
use crate::{
ContextDependency, DependencyId, Module, ModuleIdentifier, ModuleProfile,
ContextDependency, DependencyId, Module, ModuleIdentifier,
utils::task_loop::{Task, TaskResult, TaskType},
};

Expand Down Expand Up @@ -76,10 +76,6 @@ impl Task<TaskContext> for ProcessDependenciesTask {

let mut res: Vec<Box<dyn Task<TaskContext>>> = vec![];
for dependencies in sorted_dependencies.into_values() {
let current_profile = context
.compiler_options
.profile
.then(ModuleProfile::default);
let original_module_source = module_graph
.module_by_identifier(&original_module_identifier)
.and_then(|m| m.as_normal_module())
Expand Down Expand Up @@ -112,7 +108,6 @@ impl Task<TaskContext> for ProcessDependenciesTask {
dependencies,
resolve_options: module.get_resolve_options(),
options: context.compiler_options.clone(),
current_profile,
resolver_factory: context.resolver_factory.clone(),
from_unlazy,
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::{
overwrite::overwrite_tasks,
};
use crate::{
Context, Dependency, LoaderImportDependency, ModuleProfile,
Context, Dependency, LoaderImportDependency,
utils::task_loop::{Task, TaskResult, TaskType},
};

Expand Down Expand Up @@ -74,10 +74,6 @@ impl Task<ExecutorTaskContext> for EntryTask {
dependencies: vec![dep],
resolve_options: None,
options: origin_context.compiler_options.clone(),
current_profile: origin_context
.compiler_options
.profile
.then(ModuleProfile::default),
resolver_factory: origin_context.resolver_factory.clone(),
from_unlazy: false,
})]));
Expand Down
4 changes: 1 addition & 3 deletions crates/rspack_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ pub use dependencies_block::{
mod fake_namespace_object;
pub use fake_namespace_object::*;
mod runtime_template;
pub use runtime_template::*;
mod module_profile;
pub use module_profile::*;
use rspack_collections::Database;
pub use runtime_template::*;
pub mod external_module;
pub use external_module::*;
mod logger;
Expand Down
Loading
Loading