Skip to content

refactor: remove legacy severity flags from SQLBaseError and streamline formatters #1536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025

Conversation

gvozdvmozgu
Copy link
Collaborator

No description provided.

Copy link

Benchmark for 13fdf73

Click to view benchmark
Test Base PR %
DepthMap::from_parent 38.6±1.10µs 39.4±0.74µs +2.07%
fix_complex_query 8.7±0.17ms 9.6±0.84ms +10.34%
fix_superlong 88.3±7.79ms 92.6±7.42ms +4.87%
parse_complex_query 2.8±0.07µs 2.7±0.08µs -3.57%
parse_expression_recursion 5.0±0.13µs 5.0±0.08µs 0.00%
parse_simple_query 756.4±19.77ns 772.2±19.84ns +2.09%

@benfdking
Copy link
Collaborator

I am not sure this is the right approach:

  1. is the complexity worth it compared to an enum?
  2. Some of these properties like whether something is fixable or a warning is orthogonal and so be separate fields?

@gvozdvmozgu
Copy link
Collaborator Author

Hmm, looking at the code now, I think we can just introduce a Severity enum with Fatal and Warning variants (we never actually use IGNORE, so we can drop it). fixable can be a separate bool field, which won’t affect the struct’s size.

@benfdking
Copy link
Collaborator

Hmm, looking at the code now, I think we can just introduce a Severity enum with Fatal and Warning variants (we never actually use IGNORE, so we can drop it). fixable can be a separate bool field, which won’t affect the struct’s size.

Sounds great!

@gvozdvmozgu gvozdvmozgu force-pushed the bitflags-for-error-flags branch 2 times, most recently from 29fb65e to d319eda Compare April 25, 2025 18:53
Copy link

Benchmark for 92b2eb3

Click to view benchmark
Test Base PR %
DepthMap::from_parent 39.7±0.33µs 39.7±0.33µs 0.00%
fix_complex_query 9.2±0.06ms 9.7±0.70ms +5.43%
fix_superlong 94.3±6.07ms 115.3±10.92ms +22.27%
parse_complex_query 3.0±0.08µs 2.9±0.04µs -3.33%
parse_expression_recursion 5.6±0.03µs 5.1±0.11µs -8.93%
parse_simple_query 858.0±14.87ns 804.3±11.95ns -6.26%

@gvozdvmozgu gvozdvmozgu force-pushed the bitflags-for-error-flags branch from d319eda to d46a182 Compare April 25, 2025 18:58
Copy link

Benchmark for b8970b8

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.1±0.43µs 39.6±0.58µs -1.25%
fix_complex_query 9.3±0.09ms 9.5±0.51ms +2.15%
fix_superlong 102.9±6.76ms 105.7±15.47ms +2.72%
parse_complex_query 2.9±0.03µs 2.8±0.02µs -3.45%
parse_expression_recursion 5.1±0.13µs 5.1±0.38µs 0.00%
parse_simple_query 792.1±12.15ns 790.0±5.76ns -0.27%

Copy link

Benchmark for 160c713

Click to view benchmark
Test Base PR %
DepthMap::from_parent 39.7±0.36µs 39.7±0.26µs 0.00%
fix_complex_query 9.3±0.10ms 9.8±0.71ms +5.38%
fix_superlong 96.3±6.57ms 105.1±11.72ms +9.14%
parse_complex_query 2.9±0.03µs 2.9±0.11µs 0.00%
parse_expression_recursion 5.1±0.18µs 5.1±0.04µs 0.00%
parse_simple_query 811.8±9.73ns 821.9±46.85ns +1.24%

@gvozdvmozgu gvozdvmozgu force-pushed the bitflags-for-error-flags branch from d46a182 to 4838d35 Compare April 26, 2025 06:48
Copy link

Benchmark for 079d5bf

Click to view benchmark
Test Base PR %
DepthMap::from_parent 39.7±0.32µs 39.9±0.37µs +0.50%
fix_complex_query 9.5±0.27ms 9.6±0.65ms +1.05%
fix_superlong 102.1±8.21ms 105.8±12.62ms +3.62%
parse_complex_query 2.9±0.03µs 2.9±0.03µs 0.00%
parse_expression_recursion 5.1±0.05µs 5.1±0.07µs 0.00%
parse_simple_query 835.4±8.69ns 809.0±6.01ns -3.16%

@gvozdvmozgu gvozdvmozgu changed the title refactor(parser): consolidate FATAL, IGNORE, WARNING, FIXABLE into bitflags refactor: remove legacy severity flags from SQLBaseError and streamline formatters Apr 26, 2025
@benfdking benfdking force-pushed the bitflags-for-error-flags branch from 4838d35 to cdb75f2 Compare April 28, 2025 11:18
Copy link

Benchmark for 0bccfeb

Click to view benchmark
Test Base PR %
DepthMap::from_parent 40.1±0.42µs 40.6±0.33µs +1.25%
fix_complex_query 9.5±0.08ms 9.8±0.90ms +3.16%
fix_superlong 99.8±6.31ms 107.5±14.66ms +7.72%
parse_complex_query 2.9±0.03µs 2.9±0.02µs 0.00%
parse_expression_recursion 5.1±0.07µs 5.1±0.05µs 0.00%
parse_simple_query 811.5±12.88ns 816.8±6.41ns +0.65%

@benfdking benfdking merged commit 08949f4 into main Apr 28, 2025
36 checks passed
@benfdking benfdking deleted the bitflags-for-error-flags branch April 28, 2025 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants