Stream: general

Topic: cmov in Rust


Vova (Aug 05 2019 at 19:15, on Zulip):

Hey I saw this(https://github.com/xiadz/cmov) on my feed and wondered about Rust and then tested it on my pc to confirm

i8700 3.2ghz
#probability;time_branch;time_branch_0;time_branch_1;time_cmov
0.000000;0.882511;0.484089;0.884556;0.338580
0.050000;1.099530;0.879728;1.094407;0.345329
0.100000;1.277492;1.035594;1.281278;0.344896
0.150000;1.506765;0.739541;1.445742;0.346880
0.200000;1.557517;1.604143;1.527989;0.345630
0.250000;1.762647;1.217720;1.491100;0.347277
0.300000;1.650616;1.634871;1.204373;0.348672
0.350000;1.773185;2.592491;2.411367;0.340889
0.400000;2.099715;2.366262;1.649492;0.346297
0.450000;2.197287;2.867265;2.177574;0.345645
0.500000;2.397491;2.726234;2.846761;0.345180
0.550000;2.727086;3.108073;2.590671;0.353667
0.600000;1.909413;2.566348;1.776441;0.342313
0.650000;1.714653;2.332316;1.615921;0.344723
0.700000;1.388782;1.879567;1.890638;0.346914
0.750000;1.536015;2.021682;1.744568;0.343886
0.800000;1.494247;1.983500;1.541455;0.344742
0.850000;1.252894;1.702029;1.304285;0.344089
0.900000;1.070088;1.554968;1.116774;0.343721
0.950000;0.653277;1.294580;0.656864;0.343529
1.000000;0.304066;1.095976;0.303170;0.339022

so looks like on this types of benchmark the use of cmov is preferred on newer processors, maybe there are benchmarks which produce different results but I'm thinking about improving the average case scenario
I then found this issue https://github.com/rust-lang/rust/issues/53823 and looks like disabling x86-cmov-converter is the way to 'force' cmov

Is this some kind of new finding and worth reviving the issue, or I'm just wasting time :D?
should we rewrite this benchmark in Rust to see the results are the same?

Last update: Nov 21 2019 at 23:35UTC