Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Quantitative Finance · Glosarium

Apa itu Function multiversioning?

Definition 8.3 Low-Latency Software · Bab 8 — C++ for Latency III: The Compiler

Function multiversioning compiles one function several times for different instruction sets and chooses a version at run time by the processor’s features: GCC’s target_clones("avx2", "default") attribute builds both and dispatches when the program loads.

Left: the decode benchmark (Book 1’s 2 020-message sample decoded 300 times, a per-message handler in another translation unit) under seven flag sets; every set gave the same checksum. Right: summing 220 floats; with -ffast-math the sum changed. Best of five runs, g++ 11.4. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores, pinned to one CPU. Data: bench_flags.py.
Figure 8.1. Left: the decode benchmark (Book 1’s 2 020-message sample decoded 300 times, a per-message handler in another translation unit) under seven flag sets; every set gave the same checksum. Right: summing 2202^{20} floats; with -ffast-math the sum changed. Best of five runs, g++ 11.4. Measured on a laptop (Intel Core Ultra 7 155H) under WSL2, no isolated cores, pinned to one CPU. Data: bench_flags.py.
Baca dalam konteks →