@@ -22,7 +22,6 @@ fn main() {
2222 let iterations = env_usize ( "DPRINT_BENCH_ITERS" ) . unwrap_or ( 10 ) ;
2323 let import_count = env_usize ( "DPRINT_BENCH_IMPORTS" ) . unwrap_or ( 2_000 ) ;
2424 let named_count = env_usize ( "DPRINT_BENCH_NAMED_IMPORTS" ) . unwrap_or ( 2_000 ) ;
25- let call_count = env_usize ( "DPRINT_BENCH_CALLS" ) . unwrap_or ( 10_000 ) ;
2625 let parent_segments = env_usize ( "DPRINT_BENCH_PARENT_SEGMENTS" ) . unwrap_or ( 6 ) . max ( 1 ) ;
2726 let config = ConfigurationBuilder :: new ( ) . build ( ) ;
2827 let maintain_order_config = ConfigurationBuilder :: new ( )
@@ -50,20 +49,15 @@ fn main() {
5049 let grouped_imports_text = grouped_import_declarations ( import_count, parent_segments) ;
5150 let sorted_named_imports_text = sorted_named_imports ( named_count) ;
5251 let sorted_named_exports_text = sorted_named_exports ( named_count) ;
53- let simple_calls_text = simple_call_expressions ( call_count) ;
54- let chained_calls_text = chained_call_expressions ( call_count) ;
5552 let sorted_imports_parsed = parse_source ( & sorted_imports_text) ;
5653 let sorted_exports_parsed = parse_source ( & sorted_exports_text) ;
5754 let grouped_imports_parsed = parse_source ( & grouped_imports_text) ;
5855 let sorted_named_imports_parsed = parse_source ( & sorted_named_imports_text) ;
5956 let sorted_named_exports_parsed = parse_source ( & sorted_named_exports_text) ;
60- let simple_calls_parsed = parse_source ( & simple_calls_text) ;
61- let chained_calls_parsed = parse_source ( & chained_calls_text) ;
6257
6358 println ! ( "iterations: {iterations}" ) ;
6459 println ! ( "import declarations: {import_count}" ) ;
6560 println ! ( "named imports: {named_count}" ) ;
66- println ! ( "call expressions: {call_count}" ) ;
6761 println ! ( "max parent segments: {parent_segments}" ) ;
6862
6963 bench ( "sorted_import_declarations/full" , iterations, || {
@@ -108,18 +102,6 @@ fn main() {
108102 bench ( "maintain_named_exports/parsed" , iterations, || {
109103 run_format_parsed_source ( & sorted_named_exports_parsed, & maintain_order_config)
110104 } ) ;
111- bench ( "simple_call_expressions/full" , iterations, || {
112- run_format_text ( & simple_calls_text, & config)
113- } ) ;
114- bench ( "simple_call_expressions/parsed" , iterations, || {
115- run_format_parsed_source ( & simple_calls_parsed, & config)
116- } ) ;
117- bench ( "chained_call_expressions/full" , iterations, || {
118- run_format_text ( & chained_calls_text, & config)
119- } ) ;
120- bench ( "chained_call_expressions/parsed" , iterations, || {
121- run_format_parsed_source ( & chained_calls_parsed, & config)
122- } ) ;
123105}
124106
125107fn bench ( name : & str , iterations : usize , mut run : impl FnMut ( ) -> usize ) {
@@ -257,24 +239,6 @@ fn sorted_named_exports(named_count: usize) -> String {
257239 text
258240}
259241
260- fn simple_call_expressions ( call_count : usize ) -> String {
261- let mut text = String :: from ( "export function run() {\n " ) ;
262- for i in 0 ..call_count {
263- text. push_str ( & format ! ( " call{i}(value{i}, other{i});\n " ) ) ;
264- }
265- text. push_str ( "}\n " ) ;
266- text
267- }
268-
269- fn chained_call_expressions ( call_count : usize ) -> String {
270- let mut text = String :: from ( "export function run() {\n " ) ;
271- for i in 0 ..call_count {
272- text. push_str ( & format ! ( " service{i}.client.create(value{i}).send(other{i});\n " ) ) ;
273- }
274- text. push_str ( "}\n " ) ;
275- text
276- }
277-
278242fn env_usize ( name : & str ) -> Option < usize > {
279243 std:: env:: var ( name) . ok ( ) . and_then ( |value| value. parse ( ) . ok ( ) )
280244}
0 commit comments