Skip to content
Merged
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
8 changes: 6 additions & 2 deletions tasks/benchmark/benches/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use oxc_parser::{Parser, ParserReturn};
use oxc_semantic::SemanticBuilder;
use oxc_span::SourceType;
use oxc_tasks_common::TestFiles;
use oxc_transformer::{TransformOptions, Transformer};
use oxc_transformer::{ArrowFunctionsOptions, TransformOptions, Transformer};

fn bench_transformer(criterion: &mut Criterion) {
let mut group = criterion.benchmark_group("transformer");
Expand Down Expand Up @@ -42,14 +42,18 @@ fn bench_transformer(criterion: &mut Criterion) {
// in measure.
let trivias_copy = trivias.clone();

// `enable_all` enables all transforms except arrow functions transform
let mut options = TransformOptions::enable_all();
options.es2015.arrow_function = Some(ArrowFunctionsOptions { spec: true });

runner.run(|| {
let ret = Transformer::new(
&allocator,
Path::new(&file.file_name),
source_type,
source_text,
trivias,
TransformOptions::enable_all(),
options,
)
.build_with_symbols_and_scopes(symbols, scopes, program);

Expand Down