Skip to content

cgen: reduce write calls (string_builder + gen.c)#22610

Merged
spytheman merged 13 commits intovlang:masterfrom
felipensp:opt_write_calls
Oct 22, 2024
Merged

cgen: reduce write calls (string_builder + gen.c)#22610
spytheman merged 13 commits intovlang:masterfrom
felipensp:opt_write_calls

Conversation

@felipensp
Copy link
Copy Markdown
Member

@felipensp felipensp commented Oct 21, 2024

This PR aims to reduce calls to g.writeln(), g.write(), sb.write_string(), sb.writeln().

image

Huly®: V_0.6-21059

Comment thread vlib/strings/builder.c.v Outdated
Comment thread vlib/strings/builder.c.v
Comment thread vlib/v/gen/c/array.v Outdated
Comment thread vlib/v/gen/c/array.v Outdated
Comment thread vlib/v/gen/c/cgen.v Outdated
@felipensp felipensp changed the title cgen: optimize write calls cgen: reduce write calls Oct 21, 2024
@felipensp felipensp changed the title cgen: reduce write calls cgen: reduce write calls (string_builder + gen.c) Oct 21, 2024
Comment thread vlib/v/gen/c/cgen.v
Comment thread vlib/v/gen/c/cgen.v Outdated
Comment thread vlib/v/gen/c/cgen.v
@spytheman
Copy link
Copy Markdown
Contributor

spytheman commented Oct 21, 2024

The standard deviations (σ) in the above screenshot are very big, relative to the measured change. The measurements are not reliable, when that happens.

Can you redo them, on a machine, that is quiet, without other background tasks, so that the σ can be lower?

Another way would be to run v repeat with a higher -r N (the default is 10), and -a 5 for example (i.e. discard the 5 highest results, which are most likely caused by background activity/scheduling overhead on your system). That however will be slower to run, due to the increased repetitions.

@felipensp
Copy link
Copy Markdown
Member Author

The standard deviations (σ) in the above screenshot are very big, relative to the measured change. The measurements are not reliable, when that happens.

Can you redo them, on a machine, that is quiet, without other background tasks, so that the σ can be lower?

Another way would be to run v repeat with a higher -r N (the default is 10), and -a 5 for example (i.e. discard the 5 highest results, which are most likely caused by background activity/scheduling overhead on your system). That however will be slower to run, due to the increased repetitions.

Not a good machine for that. hehe But I'll try get better results. Thanks for the advices.

@felipensp felipensp marked this pull request as ready for review October 21, 2024 18:38
Comment thread vlib/strings/builder.c.v Outdated
Comment thread vlib/strings/builder.c.v Outdated
Comment thread vlib/strings/builder.c.v Outdated
Comment thread vlib/strings/builder.c.v Outdated
Comment thread vlib/strings/builder.c.v Outdated
@spytheman spytheman merged commit b2ac2ed into vlang:master Oct 22, 2024
@medvednikov
Copy link
Copy Markdown
Member

@spytheman did you manage to get reliable stats? Old code is more readable.

@felipensp felipensp deleted the opt_write_calls branch October 23, 2024 11:13
@spytheman
Copy link
Copy Markdown
Contributor

@spytheman did you manage to get reliable stats? Old code is more readable.

@medvednikov, yes, the results from a more quiet machine are below.

The TLDR is that they are inconclusive - the performance effect is not consistently positive.

It however reduced the generated C code for V itself with (6052 - 6047) = 5KB, so I decided to merge it.

#1 16:28:18 ^ use_write2_and_writeln2_in_cgen /v/oo>v run .github/workflows/compare_pr_to_master.v 
Current git branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed
    Compiling new V executables from PR branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed ...
V self compiling (-g -o v2)...
V built successfully as executable "v".
CPU: 2.83s      Real: 2.54s     Elapsed: 0:02.54        RAM: 420780KB   ./v -g self
CPU: 2.71s      Real: 2.40s     Elapsed: 0:02.40        RAM: 395052KB   ./v -o vnew1 cmd/v
CPU: 2.69s      Real: 2.40s     Elapsed: 0:02.40        RAM: 394680KB   ./vnew1 -o vnew2 cmd/v
CPU: 2.70s      Real: 2.40s     Elapsed: 0:02.40        RAM: 394716KB   ./vnew2 -o vnew cmd/v
Switched to branch 'master'
Your branch is behind 'origin/master' by 13 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
    Compiling old V executables from branch: master, commit: 7a0febb ...
V self compiling (-g -o v2)...
V built successfully as executable "v".
CPU: 2.84s      Real: 2.54s     Elapsed: 0:02.54        RAM: 421376KB   ./v -g self
CPU: 2.64s      Real: 2.35s     Elapsed: 0:02.35        RAM: 395096KB   ./v -o vold1 cmd/v
CPU: 2.64s      Real: 2.40s     Elapsed: 0:02.40        RAM: 395408KB   ./vold1 -o vold2 cmd/v
CPU: 2.64s      Real: 2.37s     Elapsed: 0:02.37        RAM: 395036KB   ./vold2 -o vold cmd/v
Switched to branch 'use_write2_and_writeln2_in_cgen'
    Measuring at PR branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed ...
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
    1   -1.9% 1.02x faster 115.8ms ± σ:   0.7ms, 115.3ms…116.8ms `./vnew -check-syntax examples/hello_world.v`
 >  2         base         118.0ms ± σ:   0.5ms, 117.3ms…118.4ms `./vold -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base         116.1ms ± σ:   0.9ms, 115.3ms…117.4ms `./vold -check-syntax examples/hello_world.v`
    2   +1.5% 1.02x slower 117.9ms ± σ:   0.1ms, 117.8ms…118.0ms `./vnew -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         115.7ms ± σ:   1.4ms, 113.8ms…117.2ms `./vold -check-syntax examples/hello_world.v`
    2   +1.9% 1.02x slower 117.9ms ± σ:   0.1ms, 117.8ms…118.1ms `./vnew -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
 >  1         base         166.6ms ± σ:   0.3ms, 166.3ms…166.9ms `./vold -check        examples/hello_world.v`
    2   +0.3% 1.00x slower 167.1ms ± σ:   0.9ms, 166.4ms…168.4ms `./vnew -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base         166.6ms ± σ:   0.4ms, 166.2ms…167.1ms `./vold -check        examples/hello_world.v`
    2   +1.8% 1.02x slower 169.6ms ± σ:   1.0ms, 168.1ms…170.4ms `./vnew -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
    1   -0.3% 1.00x faster 167.7ms ± σ:   1.5ms, 166.4ms…169.8ms `./vnew -check        examples/hello_world.v`
 >  2         base         168.2ms ± σ:   0.8ms, 167.1ms…169.0ms `./vold -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
    1   -1.4% 1.01x faster 212.9ms ± σ:   1.7ms, 211.0ms…215.2ms `./vnew -o    hw.c    examples/hello_world.v`
 >  2         base         216.0ms ± σ:   1.6ms, 214.1ms…218.0ms `./vold -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
    1   -1.6% 1.02x faster 212.0ms ± σ:   1.5ms, 210.3ms…213.9ms `./vnew -o    hw.c    examples/hello_world.v`
 >  2         base         215.6ms ± σ:   1.1ms, 214.3ms…217.1ms `./vold -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         216.8ms ± σ:   1.0ms, 215.7ms…218.1ms `./vold -o    hw.c    examples/hello_world.v`
    2   +0.1% 1.00x ~same~ 217.0ms ± σ:   1.2ms, 215.4ms…218.2ms `./vnew -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
    1   -1.9% 1.02x faster 243.4ms ± σ:   3.3ms, 239.0ms…246.8ms `./vnew -o    hw      examples/hello_world.v`
 >  2         base         248.0ms ± σ:   1.5ms, 246.0ms…249.6ms `./vold -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
    1   -1.1% 1.01x faster 244.0ms ± σ:   2.1ms, 242.0ms…247.0ms `./vnew -o    hw      examples/hello_world.v`
 >  2         base         246.8ms ± σ:   2.2ms, 243.9ms…249.2ms `./vold -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
    1   -0.6% 1.01x faster 245.9ms ± σ:   2.6ms, 242.6ms…249.1ms `./vnew -o    hw      examples/hello_world.v`
 >  2         base         247.5ms ± σ:   1.5ms, 245.5ms…249.1ms `./vold -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
 >  1         base         907.4ms ± σ:   1.5ms, 906.2ms…909.5ms `./vold -check-syntax cmd/v`
    2   +0.7% 1.01x slower 913.6ms ± σ:   2.2ms, 911.1ms…916.4ms `./vnew -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
    1   -0.5% 1.00x faster 908.9ms ± σ:   2.4ms, 905.6ms…911.3ms `./vnew -check-syntax cmd/v`
 >  2         base         913.4ms ± σ:   0.2ms, 913.1ms…913.7ms `./vold -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         912.1ms ± σ:   1.0ms, 910.7ms…913.1ms `./vold -check-syntax cmd/v`
    2   +0.0% 1.00x ~same~ 912.4ms ± σ:   2.5ms, 909.7ms…915.6ms `./vnew -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
 >  1         base         1518.5ms ± σ:   2.5ms, 1515.2ms…1521.4ms `./vold -check        cmd/v`
    2   +0.6% 1.01x slower 1527.5ms ± σ:   2.6ms, 1523.8ms…1529.4ms `./vnew -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base         1519.4ms ± σ:   2.6ms, 1515.8ms…1521.3ms `./vold -check        cmd/v`
    2   +0.4% 1.00x slower 1526.1ms ± σ:   1.3ms, 1524.7ms…1527.9ms `./vnew -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         1512.8ms ± σ:   2.0ms, 1510.7ms…1515.4ms `./vold -check        cmd/v`
    2   +0.7% 1.01x slower 1523.0ms ± σ:   1.2ms, 1521.5ms…1524.5ms `./vnew -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
 >  1         base         1946.4ms ± σ:   1.5ms, 1945.0ms…1948.5ms `./vold -o    ov.c    cmd/v`
    2   +0.4% 1.00x slower 1954.0ms ± σ:   6.8ms, 1944.6ms…1960.2ms `./vnew -o    nv.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base         1946.2ms ± σ:   1.4ms, 1944.7ms…1948.1ms `./vold -o    ov.c    cmd/v`
    2   +0.3% 1.00x slower 1952.1ms ± σ:   5.4ms, 1947.3ms…1959.7ms `./vnew -o    nv.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         1945.9ms ± σ:   4.2ms, 1939.9ms…1949.3ms `./vold -o    ov.c    cmd/v`
    2   +0.3% 1.00x slower 1950.9ms ± σ:   3.4ms, 1947.1ms…1955.3ms `./vnew -o    nv.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
 >  1         base         2375.2ms ± σ:   6.7ms, 2369.9ms…2384.8ms `./vold -o    ov      cmd/v`
    2   +0.8% 1.01x slower 2393.6ms ± σ:   3.7ms, 2388.5ms…2396.9ms `./vnew -o    nv      cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base         2379.6ms ± σ:   3.5ms, 2375.3ms…2384.0ms `./vold -o    ov      cmd/v`
    2   +0.6% 1.01x slower 2392.7ms ± σ:   9.0ms, 2380.0ms…2399.4ms `./vnew -o    nv      cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base         2369.9ms ± σ:   3.8ms, 2364.5ms…2373.1ms `./vold -o    ov      cmd/v`
    2   +0.6% 1.01x slower 2383.9ms ± σ:   1.6ms, 2381.6ms…2385.1ms `./vnew -o    nv      cmd/v`
Done.
#0 16:37:46 ^ use_write2_and_writeln2_in_cgen /v/oo>
#0 16:38:07 ^ use_write2_and_writeln2_in_cgen /v/oo>
#0 16:38:07 ^ use_write2_and_writeln2_in_cgen /v/oo>
#0 16:38:07 ^ use_write2_and_writeln2_in_cgen /v/oo>
#0 16:38:07 ^ use_write2_and_writeln2_in_cgen /v/oo>v run .github/workflows/compare_pr_to_master.v -prod
Current git branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed
    Compiling new V executables from PR branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed ...
V self compiling (-g -o v2)...
V built successfully as executable "v".
CPU: 2.81s      Real: 2.52s     Elapsed: 0:02.52        RAM: 420820KB   ./v -g self
CPU: 2.69s      Real: 2.39s     Elapsed: 0:02.39        RAM: 394680KB   ./v -o vnew1 cmd/v
CPU: 2.68s      Real: 2.38s     Elapsed: 0:02.38        RAM: 394592KB   ./vnew1 -o vnew2 cmd/v
CPU: 2.77s      Real: 2.48s     Elapsed: 0:02.48        RAM: 395068KB   ./vnew2 -o vnew cmd/v
CPU: 96.69s     Real: 99.41s    Elapsed: 1:39.41        RAM: 417720KB   ./vnew -prod -o vnew_prod cmd/v
Switched to branch 'master'
Your branch is behind 'origin/master' by 13 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
    Compiling old V executables from branch: master, commit: 7a0febb ...
V self compiling (-g -o v2)...
V built successfully as executable "v".
CPU: 2.82s      Real: 2.53s     Elapsed: 0:02.53        RAM: 421256KB   ./v -g self
CPU: 2.67s      Real: 2.38s     Elapsed: 0:02.38        RAM: 395040KB   ./v -o vold1 cmd/v
CPU: 2.65s      Real: 2.37s     Elapsed: 0:02.37        RAM: 395456KB   ./vold1 -o vold2 cmd/v
CPU: 2.63s      Real: 2.36s     Elapsed: 0:02.36        RAM: 394860KB   ./vold2 -o vold cmd/v
CPU: 96.88s     Real: 99.41s    Elapsed: 1:39.41        RAM: 417632KB   ./vold -prod -o vold_prod cmd/v
Switched to branch 'use_write2_and_writeln2_in_cgen'
    Measuring at PR branch: use_write2_and_writeln2_in_cgen, commit: b2ac2ed ...
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
    1   -0.1% 1.00x ~same~  43.7ms ± σ:   0.3ms,  43.3ms… 43.9ms `./vnew_prod -check-syntax examples/hello_world.v`
 >  2         base          43.7ms ± σ:   0.0ms,  43.7ms… 43.7ms `./vold_prod -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
    1   -0.7% 1.01x faster  43.2ms ± σ:   0.4ms,  42.8ms… 43.7ms `./vnew_prod -check-syntax examples/hello_world.v`
 >  2         base          43.5ms ± σ:   0.1ms,  43.4ms… 43.6ms `./vold_prod -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
    1   -1.2% 1.01x faster  43.2ms ± σ:   0.6ms,  42.4ms… 43.7ms `./vnew_prod -check-syntax examples/hello_world.v`
 >  2         base          43.7ms ± σ:   0.4ms,  43.1ms… 44.0ms `./vold_prod -check-syntax examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1                                                                                                                                  
    1   -2.2% 1.02x faster  60.3ms ± σ:   0.1ms,  60.2ms… 60.5ms `./vnew_prod -check        examples/hello_world.v`
 >  2         base          61.7ms ± σ:   1.4ms,  60.6ms… 63.6ms `./vold_prod -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2                                                                                                                                  
 >  1         base          60.4ms ± σ:   0.6ms,  59.5ms… 61.1ms `./vold_prod -check        examples/hello_world.v`
    2   +0.8% 1.01x slower  60.8ms ± σ:   0.6ms,  60.3ms… 61.8ms `./vnew_prod -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3                                                                                                                                  
 >  1         base          60.5ms ± σ:   0.2ms,  60.3ms… 60.7ms `./vold_prod -check        examples/hello_world.v`
    2   +0.2% 1.00x slower  60.6ms ± σ:   0.2ms,  60.4ms… 60.7ms `./vnew_prod -check        examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
 >  1         base          83.7ms ± σ:   2.7ms,  80.7ms… 87.3ms `./vold_prod -o    hw.c    examples/hello_world.v`
    2   +4.8% 1.05x slower  87.7ms ± σ:   1.0ms,  86.4ms… 88.6ms `./vnew_prod -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
    1   -2.5% 1.03x faster  85.1ms ± σ:   1.7ms,  82.7ms… 86.8ms `./vnew_prod -o    hw.c    examples/hello_world.v`
 >  2         base          87.3ms ± σ:   1.2ms,  86.2ms… 89.0ms `./vold_prod -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
    1   -0.5% 1.01x faster  86.0ms ± σ:   1.2ms,  84.7ms… 87.6ms `./vnew_prod -o    hw.c    examples/hello_world.v`
 >  2         base          86.4ms ± σ:   1.4ms,  84.5ms… 87.6ms `./vold_prod -o    hw.c    examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
    1   -4.8% 1.05x faster 114.8ms ± σ:   0.7ms, 114.2ms…115.8ms `./vnew_prod -o    hw      examples/hello_world.v`
 >  2         base         120.7ms ± σ:   0.8ms, 119.5ms…121.5ms `./vold_prod -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
 >  1         base         119.6ms ± σ:   0.4ms, 119.1ms…119.9ms `./vold_prod -o    hw      examples/hello_world.v`
    2   +0.0% 1.00x ~same~ 119.6ms ± σ:   0.2ms, 119.4ms…120.0ms `./vnew_prod -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
    1   -0.9% 1.01x faster 117.3ms ± σ:   2.1ms, 114.5ms…119.6ms `./vnew_prod -o    hw      examples/hello_world.v`
 >  2         base         118.4ms ± σ:   3.2ms, 114.1ms…121.4ms `./vold_prod -o    hw      examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
 >  1         base         324.2ms ± σ:   1.0ms, 323.0ms…325.5ms `./vold_prod -check-syntax cmd/v`
    2   +0.5% 1.00x slower 325.6ms ± σ:   2.0ms, 322.8ms…327.3ms `./vnew_prod -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
    1   -0.3% 1.00x faster 323.8ms ± σ:   1.7ms, 322.1ms…326.1ms `./vnew_prod -check-syntax cmd/v`
 >  2         base         324.9ms ± σ:   0.5ms, 324.2ms…325.3ms `./vold_prod -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
    1   -1.0% 1.01x faster 324.1ms ± σ:   1.1ms, 322.5ms…324.9ms `./vnew_prod -check-syntax cmd/v`
 >  2         base         327.4ms ± σ:   2.7ms, 324.1ms…330.9ms `./vold_prod -check-syntax cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
    1   -0.6% 1.01x faster 528.2ms ± σ:   1.4ms, 526.8ms…530.1ms `./vnew_prod -check        cmd/v`
 >  2         base         531.6ms ± σ:   1.4ms, 530.0ms…533.4ms `./vold_prod -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
    1   -0.6% 1.01x faster 528.7ms ± σ:   1.4ms, 527.4ms…530.6ms `./vnew_prod -check        cmd/v`
 >  2         base         532.0ms ± σ:   2.5ms, 528.4ms…534.0ms `./vold_prod -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
    1   -0.3% 1.00x faster 529.2ms ± σ:   0.6ms, 528.4ms…529.6ms `./vnew_prod -check        cmd/v`
 >  2         base         530.9ms ± σ:   2.2ms, 528.0ms…533.4ms `./vold_prod -check        cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
 >  1         base         753.0ms ± σ:   3.0ms, 749.1ms…756.4ms `./vold_prod -o    ov.c    cmd/v`
    2   +0.1% 1.00x ~same~ 753.5ms ± σ:   4.0ms, 747.8ms…756.9ms `./vnew_prod -o    nv.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
 >  1         base         750.5ms ± σ:   2.5ms, 747.1ms…752.8ms `./vold_prod -o    ov.c    cmd/v`
    2   +0.5% 1.00x slower 753.9ms ± σ:   2.1ms, 751.7ms…756.7ms `./vnew_prod -o    nv.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
    1   -0.5% 1.00x faster 752.3ms ± σ:   0.4ms, 751.8ms…752.6ms `./vnew_prod -o    nv.c    cmd/v`
 >  2         base         756.0ms ± σ:   0.5ms, 755.4ms…756.7ms `./vold_prod -o    ov.c    cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  1
    1   -1.0% 1.01x faster 1176.9ms ± σ:   5.4ms, 1169.3ms…1181.4ms `./vnew_prod -o    nv      cmd/v`
 >  2         base         1188.9ms ± σ:   4.1ms, 1183.4ms…1193.0ms `./vold_prod -o    ov      cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  2
    1   -0.1% 1.00x ~same~ 1179.5ms ± σ:   4.6ms, 1173.6ms…1184.9ms `./vnew_prod -o    nv      cmd/v`
 >  2         base         1181.0ms ± σ:   5.5ms, 1173.8ms…1187.1ms `./vold_prod -o    ov      cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat:  3
 >  1         base         1181.2ms ± σ:   6.3ms, 1174.2ms…1189.5ms `./vold_prod -o    ov      cmd/v`
    2   +0.3% 1.00x slower 1184.8ms ± σ:   2.1ms, 1182.3ms…1187.4ms `./vnew_prod -o    nv      cmd/v`
Done.
#0 16:45:37 ^ use_write2_and_writeln2_in_cgen /v/oo>

@spytheman
Copy link
Copy Markdown
Contributor

Old code is more readable.

I agree.

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.

4 participants