Skip to content

core:: SIMD primitives not inlined with stable Rust (1.51.0) with target-cpu=native #189

@hkratz

Description

@hkratz

I don't know why, but for some reason the SIMD core primitives are not being inlined if I build simd-json with stable Rust. It works fine with nightly (2021-04-23) though.

Stable:

$ cargo clean; RUSTFLAGS="-C target-cpu=native" cargo asm --rust simd_json::Deserializer::from_slice_with_buffers|grep core::
     call    core::core_arch::x86::avx::_mm256_setzero_si256
     call    core::core_arch::x86::avx::_mm256_setzero_si256
     call    core::core_arch::x86::avx::_mm256_setzero_si256
     call    core::core_arch::x86::avx::_mm256_loadu_si256
     [... 126 more lines elides ...]

Nightly:

$ cargo +nightly clean; RUSTFLAGS="-C target-cpu=native" cargo +nightly asm --rust simd_json::Deserializer::from_slice_w
ith_buffers|grep core::|wc -l
0

This leads to much worse performance on stable.

Benchmarks

Stable:

apache_builds/simd_json::to_tape
                        time:   [372.11 us 373.84 us 376.01 us]
                        thrpt:  [334.02 MiB/s 335.95 MiB/s 337.52 MiB/s]

Nightly:

[...]
apache_builds/simd_json::to_tape
                        time:   [67.727 us 68.317 us 68.884 us]
                        thrpt:  [1.7805 GiB/s 1.7953 GiB/s 1.8109 GiB/s]
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions