Kako Rust vektorizuje cak i cos ;)

  • Začetnik teme Začetnik teme bmaxa
  • Datum pokretanja Datum pokretanja

bmaxa

Legenda
Poruka
70.808
Napravio sam bench gde esklicitno programiram simd f-je misleci da cu tako da demonstriram koliko
se ovo isplati, medjutim ;)
Linux only.
You need fasm as well. cargo build --release or cargo bench
This was suppose to be how manual simd improves performance,
but seems that Rust vectorizes cos as well (try fold with cosine instead
of Rust's cos)
repo se moze skinuti na: https://github.com/bmaxa/planets_simd_rust
demonstracija:
Kod:
VSOP87 Mars true agner  time:   [112.06 us 113.64 us 115.41 us]
                        change: [-3.9019% -2.1104% -0.1680%] (p = 0.03 < 0.05)
                        Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
  4 (4.00%) high mild
  2 (2.00%) high severe

VSOP87 Mars true me     time:   [148.99 us 152.14 us 155.88 us]
                        change: [-1.4249% +0.4667% +2.6577%] (p = 0.67 > 0.05)
                        No change in performance detected.
Found 24 outliers among 100 measurements (24.00%)
  11 (11.00%) low mild
  5 (5.00%) high mild
  8 (8.00%) high severe

VSOP87 Mars false       time:   [218.42 us 222.58 us 227.22 us]
                        change: [+1.2273% +3.6961% +6.3131%] (p = 0.01 < 0.05)
                        Performance has regressed.
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
Dakle poboljsanje nije 4x nego 25% (u mom slucaju) i 50% u agnerovom slucaju ;)
Tu se moze videti i moja implementacija tan/cos/sin u asembleru i agnerova u cpp ;)
 

Back
Top