Skip to content

Performance improvements#22

Merged
jlogan-cfs merged 7 commits intoreleasefrom
jlogan/performance-improvements
Oct 15, 2025
Merged

Performance improvements#22
jlogan-cfs merged 7 commits intoreleasefrom
jlogan/performance-improvements

Conversation

@jlogan-cfs
Copy link
Collaborator

@jlogan-cfs jlogan-cfs commented Oct 15, 2025

2.6.0 2025-10-15

Substantial performance improvement for flux_density_linear_filament Biot-Savart methods.
This also improves performance in calculations that use these methods, such as linear filament
body force density calcs.

Added

  • Rust
    • Add dot3f and cross3f 32-bit float variants

Changed

  • Rust
    • Use mixed-precision method for flux_density_linear_filament_scalar
    • High-dynamic-range part of the calc is still done using 64-bit floats
    • Low-dynamic-range part of the calc is now done using 32-bit floats
      • All addition operations in 32-bit section are done using
        fused multiply-add operations, usually chained to defer
        roundoff to final operation. As a result, total roundoff error
        accumulated in this section is minimal.
    • Return is upcast back to 64-bit float to support precise summation downstream
    • 1.4-2x speedup without any meaningful loss of precision
      • No change to unit test tolerances needed; unlike an all-32-bit implementation,
        this mixed-precision method passes all the same tests as the 64-bit-only method
  • Python
    • Update dep versions
    • Use latest rust backend version, which includes 1.4-2x speedup for flux_density_linear_filament Biot-Savart calcs

@mdavids-cfs mdavids-cfs self-assigned this Oct 15, 2025
Copy link
Collaborator

@mdavids-cfs mdavids-cfs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@jlogan-cfs jlogan-cfs merged commit e356b14 into release Oct 15, 2025
6 checks passed
@jlogan-cfs jlogan-cfs deleted the jlogan/performance-improvements branch October 28, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants