From d2a5f7b534fb1af0d91a7494af41bae2b3e048a7 Mon Sep 17 00:00:00 2001 From: overlookmotel Date: Wed, 18 Sep 2024 10:34:13 +0100 Subject: [PATCH] ci: enable arrow function transform in transformer benchmark --- tasks/benchmark/benches/transformer.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tasks/benchmark/benches/transformer.rs b/tasks/benchmark/benches/transformer.rs index 141d78221b4046..47e645b8309d86 100644 --- a/tasks/benchmark/benches/transformer.rs +++ b/tasks/benchmark/benches/transformer.rs @@ -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"); @@ -42,6 +42,10 @@ 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, @@ -49,7 +53,7 @@ fn bench_transformer(criterion: &mut Criterion) { source_type, source_text, trivias, - TransformOptions::enable_all(), + options, ) .build_with_symbols_and_scopes(symbols, scopes, program);