File tree Expand file tree Collapse file tree 3 files changed +30602
-8
lines changed Expand file tree Collapse file tree 3 files changed +30602
-8
lines changed Original file line number Diff line number Diff line change 1+ use std:: path:: Path ;
2+
13use criterion:: { measurement:: WallTime , * } ;
24use rayon:: prelude:: * ;
35
@@ -78,14 +80,15 @@ impl TheBencher for BiomeBencher {
7880}
7981
8082fn parser_benchmark ( c : & mut Criterion ) {
81- let filename = "typescript.js" ;
82- let source = std:: fs:: read_to_string ( filename) . unwrap ( ) ;
83-
84- let mut g = c. benchmark_group ( filename) ;
85- OxcBencher :: bench ( & mut g, & source) ;
86- SwcBencher :: bench ( & mut g, & source) ;
87- BiomeBencher :: bench ( & mut g, & source) ;
88- g. finish ( ) ;
83+ let filenames = [ "typescript.js" , "cal.com.tsx" ] ;
84+ for filename in filenames {
85+ let source = std:: fs:: read_to_string ( Path :: new ( "files" ) . join ( filename) ) . unwrap ( ) ;
86+ let mut g = c. benchmark_group ( filename) ;
87+ OxcBencher :: bench ( & mut g, & source) ;
88+ SwcBencher :: bench ( & mut g, & source) ;
89+ BiomeBencher :: bench ( & mut g, & source) ;
90+ g. finish ( ) ;
91+ }
8992}
9093
9194criterion_group ! ( parser, parser_benchmark) ;
You can’t perform that action at this time.
0 commit comments