alexander-beedie opened a new pull request, #2225:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2225
Started looking at performance optimisation opportunities that don't require
structural changes - have identified several, and will make a series of PRs
that each cover just one of them, to keep things clean/focused. Hopefully there
will be a nice cumulative impact ๐
This is the first; where valid, the following updates have been made to
avoid unnecessary clones, by using the "ref" variant of several core parsing
functions:
* `peek_token` -> `peek_token_ref`
* `peek_nth_token` -> `peek_nth_token_ref`
* `expected` -> `expected_ref`
Local testing showed the following improvements to the benchmark tests in
release mode:
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโ
โ Benchmark โ Before (mean) โ After (mean) โ Change โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโค
โ sqlparser::select โ 2.74 ยตs โ 2.63 ยตs โ -4.0% โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโค
โ sqlparser::with_select โ 12.97 ยตs โ 12.86 ยตs โ -0.8% โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโค
โ parse_large_statement โ 4.78 ms โ 4.34 ms โ -9.2% โ โญ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโค
โ select_100_columns โ 68.2 ยตs โ 66.6 ยตs โ -2.3% โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโค
โ select_100_qualified_columns โ 142.2 ยตs โ 139.7 ยตs โ -1.8% โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโ
```
--
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]