mockingbirdnest / Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program
MIT License
773 stars 70 forks source link

A benchmark for a multi-table implementation of sin and cos #4011

Closed pleroy closed 6 months ago

pleroy commented 6 months ago

Not great, not terrible:

Run on (48 X 3793 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x24)
  L1 Instruction 32 KiB (x24)
  L2 Unified 512 KiB (x24)
  L3 Unified 32768 KiB (x4)
---------------------------------------------------------------------
Benchmark                           Time             CPU   Iterations
---------------------------------------------------------------------
BM_ExperimentSinMultiTable       3.24 ns         3.22 ns    213334000
BM_ExperimentCosMultiTable       3.21 ns         3.22 ns    213334000

For reference, the Windows implementation:

BM_EvaluateElementaryFunction<Metric::Throughput, std::sin>       2.22 ns         2.20 ns    298667000
BM_EvaluateElementaryFunction<Metric::Throughput, std::cos>       2.44 ns         2.40 ns    280000000

1760.