Eason0729 commented on issue #1465:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/issues/1465#issuecomment-2418364763

   
   I spent some time manually run `reg read sp fp`, and write down `rbp-rsp`.
   
   <details>
   <summary>Detail</summary>
   
   > export RUSTFLAGS="-C force-frame-pointers=yes"
   
   ```
   parse_query 12592
   parse_boxed_query_body 12592
   parse_select 17024
   parse_optional_alias 256
   parse_comma_separated 1056
   parse_select 17024
   parse_table_and_joins 10016
   parse_derived_table_factor 2384
   ```
   
   And here is some large struct(in byte):
   ```
   Expr 296
   Statement 3528
   ```
   
   ```
   let parser = Parser::new(&GenericDialect {});
   let sql = r#"
       SELECT seq
       FROM (
           SELECT seq,
           LEAD(seq) OVER (ORDER BY seq) AS next_seq
           FROM parquet_table
       ) AS subquery
       WHERE next_seq - seq > 1;
   "#;
   let stmt = parser.try_with_sql(sql).unwrap().parse_statement().unwrap();
   print!("{}", stmt.to_string());
   ```
   
   </details>
   
   In this example, sqlparser consume about 140KB stack at peak, so I think 
there is little to optimize in `sqlparser`.
   I would try, but we still need to reduce stack usage on datafusion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to