File tree Expand file tree Collapse file tree 2 files changed +20
-29
lines changed
crates/swc_ecma_parser/examples Expand file tree Collapse file tree 2 files changed +20
-29
lines changed Original file line number Diff line number Diff line change @@ -146,13 +146,6 @@ lto = true
146
146
debug = true
147
147
lto = true
148
148
149
- [profile .profiling ]
150
- debug = " limited"
151
- inherits = " release"
152
- lto = " thin"
153
- split-debuginfo = " off"
154
- strip = false
155
-
156
149
# Optimize for iteration
157
150
[profile .dev .build-override ]
158
151
opt-level = 3
Original file line number Diff line number Diff line change @@ -22,30 +22,28 @@ fn main() {
22
22
23
23
let fm = cm. load_file ( entry. path ( ) ) . unwrap ( ) ;
24
24
25
- for _ in 0 ..1000 {
26
- let lexer = Lexer :: new (
27
- Syntax :: Typescript ( TsSyntax {
28
- no_early_errors : true ,
29
- tsx : entry. path ( ) . to_string_lossy ( ) . ends_with ( ".tsx" ) ,
30
- ..Default :: default ( )
31
- } ) ,
32
- Default :: default ( ) ,
33
- StringInput :: from ( & * fm) ,
34
- None ,
35
- ) ;
36
-
37
- let mut parser = Parser :: new_from ( lexer) ;
38
-
39
- let module = parser. parse_typescript_module ( ) ;
40
-
41
- if let Ok ( module) = & module {
42
- module. hash ( & mut hasher) ;
43
- }
25
+ let lexer = Lexer :: new (
26
+ Syntax :: Typescript ( TsSyntax {
27
+ no_early_errors : true ,
28
+ tsx : entry. path ( ) . to_string_lossy ( ) . ends_with ( ".tsx" ) ,
29
+ ..Default :: default ( )
30
+ } ) ,
31
+ Default :: default ( ) ,
32
+ StringInput :: from ( & * fm) ,
33
+ None ,
34
+ ) ;
35
+
36
+ let mut parser = Parser :: new_from ( lexer) ;
37
+
38
+ let module = parser. parse_typescript_module ( ) ;
39
+
40
+ if let Ok ( module) = & module {
41
+ module. hash ( & mut hasher) ;
42
+ }
44
43
45
- let _ = black_box ( module) ;
44
+ let _ = black_box ( module) ;
46
45
47
- cnt += 1 ;
48
- }
46
+ cnt += 1 ;
49
47
}
50
48
51
49
eprintln ! ( "Parsed {} files" , cnt) ;
You can’t perform that action at this time.
0 commit comments