Skip to content

cgen,rand,hash: new wyhash v4.2#25907

Merged
spytheman merged 4 commits into
vlang:masterfrom
tankf33der:new_wyhash
Dec 7, 2025
Merged

cgen,rand,hash: new wyhash v4.2#25907
spytheman merged 4 commits into
vlang:masterfrom
tankf33der:new_wyhash

Conversation

@tankf33der

Copy link
Copy Markdown
Contributor

My attempt to update wyhash to version 4.2
I double-checked everything byte by byte and line by line by eye.
When I myself tried to check the current wyhash from the author's repo, it immediately caught my eye that the current version is not in the list of official old versions - I consider it the main disadvantage.

Updated all affected tests that involve wyhash, added all official test vectors.

If you look closely at the diff, you can see that not only the magic values were updated, but also the work with them. This slowdown (disadvantage of version 4.2 compared to the current implementation) is visible in the operation of compare_pr_to_master.v which I attach below (from my slow-cheap laptop).

Tested the new Random Number Generator using the PracRand tool, ran up to and including 4TB without obvious defects.

@tankf33der

Copy link
Copy Markdown
Contributor Author
lambda:~/v$ ./v run .github/workflows/compare_pr_to_master.v
==================================================================================================
Current git branch: new_wyhash, commit: 7fb9eec
    Compiling new V executables from PR branch: new_wyhash, commit: 7fb9eec ...
CPU: 11.94s     Real: 12.03s    Elapsed: 0m 12.03s      RAM: 467632KB   ./v -o vnew1 cmd/v
CPU: 12.83s     Real: 13.09s    Elapsed: 0m 13.09s      RAM: 467624KB   ./vnew1 -o vnew2 cmd/v
CPU: 11.59s     Real: 12.37s    Elapsed: 0m 12.37s      RAM: 467672KB   ./vnew2 -no-parallel -o vnew cmd/v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44144KB    ./vnew -no-parallel -o nhw_current.c examples/hello_world.v
CPU: 0.07s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44492KB    ./vnew -no-parallel -o nhw_current_gcc.c -cc gcc examples/hello_world.v
CPU: 1.10s      Real: 1.29s     Elapsed: 0m 1.29s       RAM: 426448KB   ./vnew -no-parallel -o nv_current.c cmd/v
>Size of        nhw_current.c:      30035
>Size of    nhw_current_gcc.c:      43135
>Size of         nv_current.c:    6843915
>Size of                 vnew:    5618296
Switched to branch 'v_repo_master'
Your branch is up to date with 'V_REPO/master'.
==================================================================================================
    Compiling old V executables from branch: v_repo_master, commit: ecd0018 ...
CPU: 13.21s     Real: 13.49s    Elapsed: 0m 13.49s      RAM: 467796KB   ./v -o vold1 cmd/v
CPU: 14.13s     Real: 14.27s    Elapsed: 0m 14.27s      RAM: 467508KB   ./vold1 -o vold2 cmd/v
CPU: 11.42s     Real: 12.19s    Elapsed: 0m 12.19s      RAM: 467620KB   ./vold2 -no-parallel -o vold cmd/v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44044KB    ./vold -no-parallel -o ohw_master.c examples/hello_world.v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44436KB    ./vold -no-parallel -o ohw_master_gcc.c -cc gcc examples/hello_world.v
CPU: 0.91s      Real: 1.06s     Elapsed: 0m 1.06s       RAM: 426308KB   ./vold -no-parallel -o ov_master.c cmd/v
>Size of         ohw_master.c:      30035
>Size of     ohw_master_gcc.c:      43135
>Size of          ov_master.c:    6843774
>Size of                 vold:    5618296
==================================================================================================
File sizes so far ...
>>>>>> size("    nhw_current.c") - size("     ohw_master.c") =      30035 -      30035 =          0
>>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") =      43135 -      43135 =          0
>>>>>> size("     nv_current.c") - size("      ov_master.c") =    6843915 -    6843774 =        141
>>>>>> size("             vnew") - size("             vold") =    5618296 -    5618296 =          0
Switched to branch 'new_wyhash'
==================================================================================================
    Measuring at PR branch: new_wyhash, commit: 7fb9eec ...
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 1257.540 ms
 >  1           base             51.0ms ± σ:    0.1ms,   50.9ms…  51.0ms `./vold -check-syntax           examples/hello_world.v`
    2     +2.4%   1.02x slower   52.2ms ± σ:    0.3ms,   52.0ms…  52.6ms `./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: 2/3, took: 1226.615 ms
    1     -1.4%   1.01x faster   50.0ms ± σ:    0.6ms,   49.2ms…  50.5ms `./vnew -check-syntax           examples/hello_world.v`
 >  2           base             50.8ms ± σ:    0.1ms,   50.6ms…  50.8ms `./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: 3/3, took: 1221.670 ms
    1     -1.5%   1.02x faster   49.6ms ± σ:    0.3ms,   49.1ms…  49.9ms `./vnew -check-syntax           examples/hello_world.v`
 >  2           base             50.3ms ± σ:    0.2ms,   50.1ms…  50.5ms `./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: 1/3, took: 1744.569 ms
 >  1           base             70.8ms ± σ:    0.2ms,   70.5ms…  71.0ms `./vold -check                  examples/hello_world.v`
    2     +3.0%   1.03x slower   72.9ms ± σ:    0.4ms,   72.3ms…  73.2ms `./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/3, took: 1747.580 ms
    1     -2.6%   1.03x faster   70.7ms ± σ:    0.5ms,   70.0ms…  71.1ms `./vnew -check                  examples/hello_world.v`
 >  2           base             72.5ms ± σ:    0.2ms,   72.2ms…  72.8ms `./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: 3/3, took: 1733.297 ms
    1     -1.0%   1.01x faster   70.5ms ± σ:    0.0ms,   70.5ms…  70.5ms `./vnew -check                  examples/hello_world.v`
 >  2           base             71.2ms ± σ:    0.3ms,   70.9ms…  71.5ms `./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/3, took: 2001.427 ms
 >  1           base             81.0ms ± σ:    0.2ms,   80.8ms…  81.2ms `./vold -no-parallel -o ohw.c   examples/hello_world.v`
    2     +0.6%   1.01x slower   81.5ms ± σ:    0.2ms,   81.3ms…  81.7ms `./vnew -no-parallel -o nhw.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/3, took: 1978.732 ms
 >  1           base             80.5ms ± σ:    0.2ms,   80.3ms…  80.8ms `./vold -no-parallel -o ohw.c   examples/hello_world.v`
    2     +1.2%   1.01x slower   81.4ms ± σ:    0.1ms,   81.2ms…  81.6ms `./vnew -no-parallel -o nhw.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/3, took: 1978.249 ms
 >  1           base             81.5ms ± σ:    0.4ms,   81.0ms…  81.9ms `./vold -no-parallel -o ohw.c   examples/hello_world.v`
    2     +0.0%   1.00x ~same~   81.5ms ± σ:    0.3ms,   81.3ms…  81.9ms `./vnew -no-parallel -o nhw.c   examples/hello_world.v`
>>>>>> size("            nhw.c") - size("            ohw.c") =      30035 -      30035 =          0
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 2157.541 ms
 >  1           base             88.0ms ± σ:    0.2ms,   87.7ms…  88.3ms `./vold -no-parallel -o ohw.exe examples/hello_world.v`
    2     +1.0%   1.01x slower   88.9ms ± σ:    0.1ms,   88.8ms…  89.1ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 2146.507 ms
 >  1           base             87.8ms ± σ:    0.4ms,   87.2ms…  88.2ms `./vold -no-parallel -o ohw.exe examples/hello_world.v`
    2     +1.2%   1.01x slower   88.9ms ± σ:    0.3ms,   88.5ms…  89.1ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 2159.896 ms
 >  1           base             87.7ms ± σ:    0.4ms,   87.2ms…  88.0ms `./vold -no-parallel -o ohw.exe examples/hello_world.v`
    2     +1.0%   1.01x slower   88.6ms ± σ:    0.2ms,   88.4ms…  88.9ms `./vnew -no-parallel -o nhw.exe examples/hello_world.v`
>>>>>> size("          nhw.exe") - size("          ohw.exe") =     233704 -     233704 =          0
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 9546.323 ms
 >  1           base            393.9ms ± σ:    0.5ms,  393.3ms… 394.5ms `./vold -check-syntax           cmd/v`
    2     +0.7%   1.01x slower  396.7ms ± σ:    1.2ms,  395.2ms… 398.0ms `./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/3, took: 9581.137 ms
 >  1           base            393.3ms ± σ:    0.1ms,  393.2ms… 393.5ms `./vold -check-syntax           cmd/v`
    2     +0.7%   1.01x slower  396.3ms ± σ:    1.2ms,  394.9ms… 397.8ms `./vnew -check-syntax           cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 9855.260 ms
 >  1           base            393.8ms ± σ:    0.4ms,  393.3ms… 394.3ms `./vold -check-syntax           cmd/v`
    2     +0.8%   1.01x slower  396.9ms ± σ:    1.0ms,  396.0ms… 398.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: 1/3, took: 17743.196 ms
 >  1           base            688.1ms ± σ:    3.3ms,  684.3ms… 692.4ms `./vold -check                  cmd/v`
    2     +3.1%   1.03x slower  709.2ms ± σ:    1.4ms,  707.8ms… 711.1ms `./vnew -check                  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 18634.066 ms
    1     -3.7%   1.04x faster  709.8ms ± σ:   14.8ms,  688.9ms… 720.9ms `./vnew -check                  cmd/v`
 >  2           base            736.9ms ± σ:    4.8ms,  730.8ms… 742.5ms `./vold -check                  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 16553.288 ms
    1     -1.0%   1.01x faster  652.5ms ± σ:    1.1ms,  651.0ms… 653.3ms `./vnew -check                  cmd/v`
 >  2           base            659.3ms ± σ:    3.6ms,  655.1ms… 663.9ms `./vold -check                  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 26135.829 ms
 >  1           base           1066.2ms ± σ:    1.5ms, 1064.3ms…1067.8ms `./vold -no-parallel -o ov.c    cmd/v`
    2     +0.5%   1.00x slower 1071.1ms ± σ:    4.6ms, 1065.2ms…1076.5ms `./vnew -no-parallel -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/3, took: 25810.638 ms
 >  1           base           1068.0ms ± σ:    1.1ms, 1067.1ms…1069.6ms `./vold -no-parallel -o ov.c    cmd/v`
    2     +0.2%   1.00x slower 1069.7ms ± σ:    2.5ms, 1066.7ms…1072.7ms `./vnew -no-parallel -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/3, took: 26011.240 ms
 >  1           base           1062.8ms ± σ:    3.7ms, 1060.0ms…1068.0ms `./vold -no-parallel -o ov.c    cmd/v`
    2     +0.1%   1.00x ~same~ 1064.3ms ± σ:    2.1ms, 1061.5ms…1066.6ms `./vnew -no-parallel -o nv.c    cmd/v`
>>>>>> size("             nv.c") - size("             ov.c") =    6843915 -    6843846 =         69
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 286316.819 ms
 >  1           base           11832.7ms ± σ:   10.3ms, 11819.2ms…11844.2ms `./vold -no-parallel -o ov.exe  cmd/v`
    2     +0.3%   1.00x slower 11862.8ms ± σ:   23.8ms, 11829.9ms…11885.5ms `./vnew -no-parallel -o nv.exe  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 293165.829 ms
 >  1           base           12062.8ms ± σ:   38.4ms, 12008.5ms…12090.6ms `./vold -no-parallel -o ov.exe  cmd/v`
    2     +1.0%   1.01x slower 12182.9ms ± σ:   31.7ms, 12138.1ms…12206.6ms `./vnew -no-parallel -o nv.exe  cmd/v`
Command: ./vnew -no-parallel -o nv.exe  cmd/v,  2/2, 1/1, current average: 12175.569ms, run    6/10  , took: 11929.06 mss
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 291022.885 ms
    1     -1.3%   1.01x faster 11855.6ms ± σ:    5.1ms, 11849.7ms…11862.1ms `./vnew -no-parallel -o nv.exe  cmd/v`
 >  2           base           12017.4ms ± σ:   47.2ms, 11968.4ms…12081.2ms `./vold -no-parallel -o ov.exe  cmd/v`
>>>>>> size("           nv.exe") - size("           ov.exe") =    5618304 -    5618304 =          0
Done. Total time: 1132.864453002 s.
==================================================================================================
Final summary for file diff sizes on their own branches:
>>>>>> size("    nhw_current.c") - size("     ohw_master.c") =      30035 -      30035 =          0
>>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") =      43135 -      43135 =          0
>>>>>> size("     nv_current.c") - size("      ov_master.c") =    6843915 -    6843774 =        141
>>>>>> size("             vnew") - size("             vold") =    5618296 -    5618296 =          0
==================================================================================================
Final summary for file diff sizes for generated files on the *current* branch:
>>>>>> size("            nhw.c") - size("            ohw.c") =      30035 -      30035 =          0
>>>>>> size("             nv.c") - size("             ov.c") =    6843915 -    6843846 =         69
>>>>>> size("          nhw.exe") - size("          ohw.exe") =     233704 -     233704 =          0
>>>>>> size("           nv.exe") - size("           ov.exe") =    5618304 -    5618304 =          0
lambda:~/v$

@tankf33der

Copy link
Copy Markdown
Contributor Author

Do I need to create my own separate PR in vsl? Please advise what to do.

@spytheman

Copy link
Copy Markdown
Contributor

Do I need to create my own separate PR in vsl? Please advise what to do.

Preferably yes - some of the tests there are brittle and depend on the versions of the exact hash and pseudo random generators used by default :-| .

@spytheman

Copy link
Copy Markdown
Contributor

Can you please also run:
./v run .github/workflows/compare_pr_to_master.v -prod

The slowdown may be (hopefully) just for the version compiled with tcc.

Comment thread vlib/datatypes/bloom_filter_test.v
Comment thread vlib/hash/hash_compiles_test.v
Comment thread vlib/rand/dist_test.v
const count = 2000
// Accepted error is within 5% of the actual values.
const error = 0.05
const error = 0.06

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is that increased?
If that is indeed needed, please also update the comment above it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Intuitively, I would have expected that the deviations, would have been ~ the same, as long as the pseudo random generator was ~ of the same quality 🤔 .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With 0.5 it fails this way. Almost equal:

vlib/rand/dist_test.v:127: ✗ fn test_exponential
  > assert math.abs((f64(var / 2000) - variance) / variance) < f64(2 * 0.05)
    Left value (len: 19):
      `0.10262020251738975`
    Right value (len: 3):
      `0.1`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it is better to modify just this assertion, if the rest fit within the const error = 0.05 margin.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

perhaps only tweak the 2 coefficient locally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I spent these hours finding a new beautiful seed value at which the test passes at the old error threshold of 5%. What you think?

diff --git a/vlib/rand/dist_test.v b/vlib/rand/dist_test.v
index 17081a97d..e4893280b 100644
--- a/vlib/rand/dist_test.v
+++ b/vlib/rand/dist_test.v
@@ -4,9 +4,9 @@ import rand
 // The sample size to be used
 const count = 2000
 // Accepted error is within 5% of the actual values.
-const error = 0.06
+const error = 0.05
 // The seeds used (for reproducible testing)
-const seeds = [[u32(0xffff24), 0xabcd], [u32(0x141024), 0x42851],
+const seeds = [[u32(0x24ffff), 0xabcd], [u32(0x141024), 0x42851],
        [u32(0x1452), 0x90cd]]
 
 fn test_bernoulli() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cool, thank you 🙇🏻

@tankf33der

Copy link
Copy Markdown
Contributor Author

Can you please also run: ./v run .github/workflows/compare_pr_to_master.v -prod

The slowdown may be (hopefully) just for the version compiled with tcc.

lambda:~/v$ ./v run .github/workflows/compare_pr_to_master.v -prod
==================================================================================================
Current git branch: new_wyhash, commit: 7fb9eec
    Compiling new V executables from PR branch: new_wyhash, commit: 7fb9eec ...
CPU: 11.75s     Real: 11.86s    Elapsed: 0m 11.86s      RAM: 467588KB   ./v -o vnew1 cmd/v
CPU: 11.79s     Real: 11.89s    Elapsed: 0m 11.89s      RAM: 467540KB   ./vnew1 -o vnew2 cmd/v
CPU: 11.14s     Real: 11.87s    Elapsed: 0m 11.87s      RAM: 467724KB   ./vnew2 -no-parallel -o vnew cmd/v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44004KB    ./vnew -no-parallel -o nhw_current.c examples/hello_world.v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44132KB    ./vnew -no-parallel -o nhw_current_gcc.c -cc gcc examples/hello_world.v
CPU: 0.94s      Real: 1.07s     Elapsed: 0m 1.07s       RAM: 425416KB   ./vnew -no-parallel -o nv_current.c cmd/v

CPU: 85.06s     Real: 96.50s    Elapsed: 1m 36.50s      RAM: 475172KB   ./vnew -no-parallel -prod -o vnew_prod cmd/v
>Size of        nhw_current.c:      30035
>Size of    nhw_current_gcc.c:      43135
>Size of         nv_current.c:    6843915
>Size of                 vnew:    5618296
>Size of            vnew_prod:    4498448
Switched to branch 'v_repo_master'
Your branch is up to date with 'V_REPO/master'.
==================================================================================================
    Compiling old V executables from branch: v_repo_master, commit: ff6413a ...
CPU: 11.77s     Real: 11.88s    Elapsed: 0m 11.88s      RAM: 467944KB   ./v -o vold1 cmd/v
CPU: 11.69s     Real: 11.85s    Elapsed: 0m 11.85s      RAM: 468028KB   ./vold1 -o vold2 cmd/v
CPU: 11.07s     Real: 11.83s    Elapsed: 0m 11.83s      RAM: 467860KB   ./vold2 -no-parallel -o vold cmd/v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 43848KB    ./vold -no-parallel -o ohw_master.c examples/hello_world.v
CPU: 0.06s      Real: 0.08s     Elapsed: 0m 0.08s       RAM: 44112KB    ./vold -no-parallel -o ohw_master_gcc.c -cc gcc examples/hello_world.v
CPU: 0.90s      Real: 1.05s     Elapsed: 0m 1.05s       RAM: 426288KB   ./vold -no-parallel -o ov_master.c cmd/v
CPU: 84.88s     Real: 96.01s    Elapsed: 1m 36.01s      RAM: 474352KB   ./vold -no-parallel -prod -o vold_prod cmd/v
>Size of            vold_prod:    4498448
>Size of         ohw_master.c:      30035
>Size of     ohw_master_gcc.c:      43135
>Size of          ov_master.c:    6848363
>Size of                 vold:    5622392
>Size of            vold_prod:    4498448
==================================================================================================
File sizes so far ...
>>>>>> size("    nhw_current.c") - size("     ohw_master.c") =      30035 -      30035 =          0
>>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") =      43135 -      43135 =          0
>>>>>> size("     nv_current.c") - size("      ov_master.c") =    6843915 -    6848363 =      -4448
>>>>>> size("             vnew") - size("             vold") =    5618296 -    5622392 =      -4096
Switched to branch 'new_wyhash'
==================================================================================================
    Measuring at PR branch: new_wyhash, commit: 7fb9eec ...
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took:  763.749 ms                                                             
    1     -2.4%   1.02x faster   30.5ms ± σ:    0.5ms,   30.1ms…  31.2ms `./vnew_prod -check-syntax           examples/hello_world.v`
 >  2           base             31.3ms ± σ:    0.5ms,   30.8ms…  31.9ms `./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/3, took:  748.392 ms                                                             
    1     -2.6%   1.03x faster   30.0ms ± σ:    0.2ms,   29.8ms…  30.1ms `./vnew_prod -check-syntax           examples/hello_world.v`
 >  2           base             30.8ms ± σ:    0.0ms,   30.7ms…  30.8ms `./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/3, took:  745.308 ms                                                             
    1     -0.7%   1.01x faster   30.3ms ± σ:    0.2ms,   30.1ms…  30.5ms `./vnew_prod -check-syntax           examples/hello_world.v`
 >  2           base             30.5ms ± σ:    0.1ms,   30.4ms…  30.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: 1/3, took:  992.204 ms                                                             
    1     -0.1%   1.00x ~same~   40.9ms ± σ:    0.3ms,   40.4ms…  41.2ms `./vnew_prod -check                  examples/hello_world.v`
 >  2           base             40.9ms ± σ:    0.0ms,   40.9ms…  40.9ms `./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/3, took:  991.185 ms                                                             
    1     -1.1%   1.01x faster   40.4ms ± σ:    0.3ms,   40.1ms…  40.9ms `./vnew_prod -check                  examples/hello_world.v`
 >  2           base             40.9ms ± σ:    0.2ms,   40.7ms…  41.1ms `./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: 3/3, took:  993.987 ms                                                             
    1     -0.3%   1.00x faster   40.7ms ± σ:    0.3ms,   40.3ms…  41.0ms `./vnew_prod -check                  examples/hello_world.v`
 >  2           base             40.8ms ± σ:    0.4ms,   40.2ms…  41.2ms `./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: 1/3, took: 1153.509 ms                                                             
 >  1           base             47.3ms ± σ:    0.5ms,   46.7ms…  47.9ms `./vold_prod -no-parallel -o ohw.c   examples/hello_world.v`
    2     +0.1%   1.00x ~same~   47.3ms ± σ:    0.4ms,   46.8ms…  47.9ms `./vnew_prod -no-parallel -o nhw.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/3, took: 1161.355 ms                                                             
 >  1           base             47.6ms ± σ:    0.2ms,   47.5ms…  47.8ms `./vold_prod -no-parallel -o ohw.c   examples/hello_world.v`
    2     +0.0%   1.00x ~same~   47.6ms ± σ:    0.3ms,   47.3ms…  47.9ms `./vnew_prod -no-parallel -o nhw.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/3, took: 1156.765 ms                                                             
    1     -0.7%   1.01x faster   47.3ms ± σ:    0.4ms,   46.7ms…  47.6ms `./vnew_prod -no-parallel -o nhw.c   examples/hello_world.v`
 >  2           base             47.6ms ± σ:    0.2ms,   47.4ms…  47.8ms `./vold_prod -no-parallel -o ohw.c   examples/hello_world.v`
>>>>>> size("            nhw.c") - size("            ohw.c") =      30035 -      30035 =          0
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 1340.356 ms                                                             
 >  1           base             54.6ms ± σ:    0.2ms,   54.4ms…  54.8ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v`
    2     +0.1%   1.00x ~same~   54.7ms ± σ:    0.2ms,   54.3ms…  54.8ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 1335.754 ms                                                             
    1     -0.6%   1.01x faster   54.4ms ± σ:    0.2ms,   54.3ms…  54.7ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v`
 >  2           base             54.8ms ± σ:    0.4ms,   54.4ms…  55.3ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 1344.576 ms                                                             
    1     -0.1%   1.00x ~same~   55.4ms ± σ:    0.3ms,   55.0ms…  55.7ms `./vnew_prod -no-parallel -o nhw.exe examples/hello_world.v`
 >  2           base             55.5ms ± σ:    0.1ms,   55.3ms…  55.6ms `./vold_prod -no-parallel -o ohw.exe examples/hello_world.v`
>>>>>> size("          nhw.exe") - size("          ohw.exe") =     233704 -     233704 =          0
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 5653.061 ms                                                             
    1     -0.3%   1.00x faster  232.4ms ± σ:    0.3ms,  232.0ms… 232.7ms `./vnew_prod -check-syntax           cmd/v`
 >  2           base            233.1ms ± σ:    0.3ms,  232.8ms… 233.4ms `./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: 2/3, took: 5644.131 ms                                                             
 >  1           base            232.5ms ± σ:    0.1ms,  232.4ms… 232.6ms `./vold_prod -check-syntax           cmd/v`
    2     +0.8%   1.01x slower  234.5ms ± σ:    1.0ms,  233.1ms… 235.2ms `./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: 3/3, took: 5645.302 ms                                                             
    1     -0.3%   1.00x faster  233.1ms ± σ:    0.2ms,  232.9ms… 233.2ms `./vnew_prod -check-syntax           cmd/v`
 >  2           base            233.7ms ± σ:    0.5ms,  233.0ms… 234.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: 1/3, took: 8847.526 ms                                                             
 >  1           base            365.7ms ± σ:    0.6ms,  365.1ms… 366.6ms `./vold_prod -check                  cmd/v`
    2     +0.1%   1.00x ~same~  365.9ms ± σ:    0.1ms,  365.8ms… 366.1ms `./vnew_prod -check                  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 8865.610 ms                                                             
    1     -0.4%   1.00x faster  366.0ms ± σ:    0.3ms,  365.6ms… 366.3ms `./vnew_prod -check                  cmd/v`
 >  2           base            367.4ms ± σ:    0.6ms,  366.6ms… 368.1ms `./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/3, took: 8823.953 ms                                                             
 >  1           base            363.6ms ± σ:    0.1ms,  363.4ms… 363.7ms `./vold_prod -check                  cmd/v`
    2     +0.6%   1.01x slower  365.8ms ± σ:    0.5ms,  365.2ms… 366.3ms `./vnew_prod -check                  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 14575.378 ms                                                            
 >  1           base            600.4ms ± σ:    1.1ms,  598.8ms… 601.3ms `./vold_prod -no-parallel -o ov.c    cmd/v`
    2     +0.5%   1.01x slower  603.5ms ± σ:    0.7ms,  602.5ms… 604.3ms `./vnew_prod -no-parallel -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/3, took: 15380.840 ms                                                            
 >  1           base            609.4ms ± σ:    5.8ms,  603.0ms… 617.1ms `./vold_prod -no-parallel -o ov.c    cmd/v`
    2     +2.3%   1.02x slower  623.1ms ± σ:    9.8ms,  611.6ms… 635.5ms `./vnew_prod -no-parallel -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/3, took: 14548.289 ms                                                            
 >  1           base            601.4ms ± σ:    1.2ms,  599.7ms… 602.4ms `./vold_prod -no-parallel -o ov.c    cmd/v`
    2     +0.1%   1.00x ~same~  602.1ms ± σ:    0.4ms,  601.5ms… 602.6ms `./vnew_prod -no-parallel -o nv.c    cmd/v`
>>>>>> size("             nv.c") - size("             ov.c") =    6843915 -    6843846 =         69
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 1/3, took: 274127.570 ms                                                           
    1     -0.0%   1.00x ~same~ 11389.8ms ± σ:    2.0ms, 11387.9ms…11392.6ms `./vnew_prod -no-parallel -o nv.exe  cmd/v`
 >  2           base           11393.4ms ± σ:    4.2ms, 11390.2ms…11399.4ms `./vold_prod -no-parallel -o ov.exe  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 2/3, took: 274460.866 ms                                                           
    1     -0.1%   1.00x ~same~ 11382.2ms ± σ:    1.5ms, 11380.7ms…11384.2ms `./vnew_prod -no-parallel -o nv.exe  cmd/v`
 >  2           base           11389.9ms ± σ:   10.6ms, 11378.8ms…11404.1ms `./vold_prod -no-parallel -o ov.exe  cmd/v`
Summary after 1 series x 10 runs (%s are relative to first command, or `base`), discard maxs:  7, repeat: 3/3, took: 273973.418 ms                                                           
    1     -0.1%   1.00x ~same~ 11380.7ms ± σ:    4.1ms, 11376.3ms…11386.2ms `./vnew_prod -no-parallel -o nv.exe  cmd/v`
 >  2           base           11389.3ms ± σ:    1.1ms, 11388.5ms…11390.8ms `./vold_prod -no-parallel -o ov.exe  cmd/v`
>>>>>> size("           nv.exe") - size("           ov.exe") =    5618304 -    5618304 =          0
Done. Total time: 1190.775753828 s.
==================================================================================================
Final summary for file diff sizes on their own branches:
>>>>>> size("    nhw_current.c") - size("     ohw_master.c") =      30035 -      30035 =          0
>>>>>> size("nhw_current_gcc.c") - size(" ohw_master_gcc.c") =      43135 -      43135 =          0
>>>>>> size("     nv_current.c") - size("      ov_master.c") =    6843915 -    6848363 =      -4448
>>>>>> size("             vnew") - size("             vold") =    5618296 -    5622392 =      -4096
>>>>>> size("        vnew_prod") - size("        vold_prod") =    4498448 -    4498448 =          0
==================================================================================================
Final summary for file diff sizes for generated files on the *current* branch:
>>>>>> size("            nhw.c") - size("            ohw.c") =      30035 -      30035 =          0
>>>>>> size("             nv.c") - size("             ov.c") =    6843915 -    6843846 =         69
>>>>>> size("          nhw.exe") - size("          ohw.exe") =     233704 -     233704 =          0
>>>>>> size("           nv.exe") - size("           ov.exe") =    5618304 -    5618304 =          0
lambda:~/v$ 

@tankf33der

Copy link
Copy Markdown
Contributor Author

Do I need to create my own separate PR in vsl? Please advise what to do.

Preferably yes - some of the tests there are brittle and depend on the versions of the exact hash and pseudo random generators used by default :-| .

Let me know if you accept wyhash 4.2 and the merge will be done, and I'll then immediately create the needed PR.

@spytheman

Copy link
Copy Markdown
Contributor

Let me know if you accept wyhash 4.2 and the merge will be done, and I'll then immediately create the needed PR.

I do in general. It is better to stick to the latest version of the hash.
The tcc regression is a bit unfortunate, and I will have to measure a bit more.

The PRs to vls and vsl, will be needed so that they could be merged and tested right before merging this one. I want to minimize the time window, during the CI for other unrelated PRs here could potentially break, and thus when they will need to be rebased.

@spytheman spytheman merged commit 377b80e into vlang:master Dec 7, 2025
83 of 85 checks passed
@spytheman

Copy link
Copy Markdown
Contributor

Thank you @tankf33der 🙇🏻 .
Excellent work.

spytheman added a commit that referenced this pull request Dec 7, 2025
Krchi pushed a commit to Krchi/v that referenced this pull request Dec 13, 2025
Krchi pushed a commit to Krchi/v that referenced this pull request Dec 13, 2025
@tankf33der tankf33der mentioned this pull request Dec 27, 2025
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