Closed adamchainz closed 6 months ago
Attention: Patch coverage is 85.71429%
with 2 lines
in your changes are missing coverage. Please review.
Project coverage is 96.92%. Comparing base (
60486b9
) to head (e7eab4c
).
Files | Patch % | Lines |
---|---|---|
sqlparse/utils.py | 85.71% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for the patch! That makes the code much more readable as well.
Thanks for contributing!
Before submitting your pull request please have a look at the following checklist:
pytest
)flake8
)Profiling a
sqlparse.parse()
on a bunch of largeSELECT
queries, 14ms out of 59ms, or ~24% of the time, was spent insqlparse.utils.imt()
.Looking at that function, it did some moving of the
m
andt
parameters into lists, wasting work when they’re not set or a single element which can use a faster check. To mitigate this, I optimized it to do the check only when the parameters are set, and avoid the listification of single elements.This doubled its speed, saving 7ms in the same profile.