You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wavec build/run default to -O0, which is ~4x slower than -O2; the default is not documented #930
wavec build / wavec run compile at -O0 unless an optimization flag is given, and the difference is large: about 4x on integer- and array-heavy code. Nothing I found tells a new user that the default is unoptimized.
Measurement
A pure-Wave number-conversion routine (a double-to-shortest-decimal formatter and a decimal-to-double parser built on a fixed-size big integer, about 1000 lines), timed on 200,000 values with a C++ implementation of the same algorithm as the baseline (C++ built with -O2):
case
C++ -O2
Wave default
Wave -O0
Wave -O2
Wave -O3
format, short numbers
22 ms
118 ms
108 ms
36 ms
37 ms
format, random doubles
340 ms
1294 ms
1304 ms
336 ms
346 ms
parse, random doubles
185 ms
656 ms
667 ms
210 ms
191 ms
The default build behaves exactly like an explicit -O0 (compare the two Wave columns), and -O2 brings the Wave code level with C++. -O2 is accepted before or after the subcommand (wavec -O2 run f.wave, wavec run -O2 f.wave).
Same source, same machine, same compiler, only the flag changes.
Suggestion
Either default build / run to an optimizing level (keeping -O0 for debug builds), or print the active level in the build output and mention in the getting-started docs that -O2 should be used for anything performance-sensitive or benchmarked.
Activity
Fix bundled std discovery and float literal/output handling (#932)