Skip to content

Basic Q# Formatter#1172

Merged
ScottCarda-MS merged 78 commits into
mainfrom
sccarda/Formatter
Mar 19, 2024
Merged

Basic Q# Formatter#1172
ScottCarda-MS merged 78 commits into
mainfrom
sccarda/Formatter

Conversation

@ScottCarda-MS
Copy link
Copy Markdown
Contributor

@ScottCarda-MS ScottCarda-MS commented Feb 16, 2024

Adds a Q# formatter to the compiler with some basic abilities.

The formatter is added to the VScode extension and is triggered manually with the VScode format command, which may be set to run on save, depending on user settings.

Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread compiler/qsc_parse/src/lex/concrete.rs Outdated
Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread compiler/qsc_parse/src/lex/formatter.rs Outdated
Comment thread samples/algorithms/PhaseFlipCode.qs Outdated
Comment thread samples/estimation/df-chemistry/src/df_chemistry.qs Outdated
Comment thread samples/estimation/df-chemistry/src/df_chemistry.qs Outdated
Comment thread library/src/tests/resources/state_preparation.qs Outdated
Comment thread library/src/tests/resources/state_preparation.qs Outdated
Comment thread samples/algorithms/BitFlipCode.qs
@github-actions
Copy link
Copy Markdown

Benchmark for 5ea3349

Click to view benchmark
Test Base PR %
Array append evaluation 747.6±6.43µs 742.3±4.72µs -0.71%
Array literal evaluation 299.7±3.70µs 299.9±2.23µs +0.07%
Array update evaluation 750.5±4.94µs 749.9±4.46µs -0.08%
Deutsch-Jozsa evaluation 6.3±0.20ms 6.2±0.05ms -1.59%
Large file parity evaluation 35.2±0.12ms 35.1±0.50ms -0.28%
Large input file 35.0±0.84ms 32.8±1.16ms -6.29%
Large nested iteration 77.4±1.08ms 77.6±1.84ms +0.26%
Standard library 19.5±0.90ms 17.5±0.78ms -10.26%
Teleport evaluation 91.1±2.80µs 93.0±3.46µs +2.09%

Comment thread compiler/qsc_eval/src/tests.rs Outdated
Comment thread vscode/package.json Outdated
Comment thread vscode/src/config.ts Outdated
@github-actions
Copy link
Copy Markdown

Benchmark for fcd4c88

Click to view benchmark
Test Base PR %
Array append evaluation 744.6±11.55µs 750.3±5.11µs +0.77%
Array literal evaluation 300.6±4.65µs 335.8±4.64µs +11.71%
Array update evaluation 752.2±10.92µs 756.0±7.44µs +0.51%
Deutsch-Jozsa evaluation 6.2±0.05ms 6.2±0.19ms 0.00%
Large file parity evaluation 35.5±0.21ms 35.7±0.22ms +0.56%
Large input file 33.4±3.50ms 31.1±1.52ms -6.89%
Large nested iteration 76.9±1.99ms 77.7±1.00ms +1.04%
Standard library 20.2±2.42ms 16.9±0.50ms -16.34%
Teleport evaluation 91.5±2.40µs 91.8±1.89µs +0.33%

@github-actions
Copy link
Copy Markdown

Benchmark for a30fd2e

Click to view benchmark
Test Base PR %
Array append evaluation 743.7±3.47µs 754.1±7.94µs +1.40%
Array literal evaluation 298.5±2.36µs 313.0±2.88µs +4.86%
Array update evaluation 750.1±3.50µs 757.1±3.31µs +0.93%
Deutsch-Jozsa evaluation 6.3±0.04ms 6.2±0.04ms -1.59%
Large file parity evaluation 35.2±0.10ms 35.2±0.14ms 0.00%
Large input file 35.0±1.06ms 35.3±0.97ms +0.86%
Large nested iteration 77.6±1.09ms 76.3±1.01ms -1.68%
Standard library 19.1±0.79ms 19.2±0.80ms +0.52%
Teleport evaluation 91.1±1.95µs 91.5±2.25µs +0.44%

@ScottCarda-MS ScottCarda-MS enabled auto-merge March 18, 2024 23:41
Comment thread vscode/src/extension.ts Outdated
Comment thread vscode/src/format.ts Outdated
Copy link
Copy Markdown
Member

@billti billti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor things to fix up, and I didn't look at the Rust code too much as I assume Mine did, else looks good. Thanks!

@github-actions
Copy link
Copy Markdown

Benchmark for 4262a19

Click to view benchmark
Test Base PR %
Array append evaluation 785.8±17.18µs 776.9±3.06µs -1.13%
Array literal evaluation 299.9±3.31µs 302.8±2.81µs +0.97%
Array update evaluation 784.2±4.08µs 782.6±2.55µs -0.20%
Deutsch-Jozsa evaluation 6.3±0.04ms 6.3±0.05ms 0.00%
Large file parity evaluation 35.2±0.85ms 35.2±0.15ms 0.00%
Large input file 35.5±0.86ms 33.9±1.57ms -4.51%
Large nested iteration 80.4±1.00ms 80.1±0.98ms -0.37%
Standard library 19.5±0.97ms 17.9±1.42ms -8.21%
Teleport evaluation 91.5±2.46µs 92.6±3.06µs +1.20%

@ScottCarda-MS ScottCarda-MS added this pull request to the merge queue Mar 19, 2024
Merged via the queue into main with commit ee5edf3 Mar 19, 2024
@ScottCarda-MS ScottCarda-MS deleted the sccarda/Formatter branch March 19, 2024 06:45
@ScottCarda-MS ScottCarda-MS mentioned this pull request Mar 21, 2024
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.

6 participants