Skip to content

Commit

Permalink
ci(transformer): enable arrow function transform in transformer bench…
Browse files Browse the repository at this point in the history
…mark (#5851)
  • Loading branch information
overlookmotel committed Sep 18, 2024
1 parent ef8dcc9 commit 2e93548
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 2e93548

Please sign in to comment.