Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use FastPower.jl for faster power function #472

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Use FastPower.jl for faster power function #472

wants to merge 2 commits into from

Conversation

visr
Copy link
Member

@visr visr commented Oct 1, 2024

This package was registered today: https://github.com/SciML/FastPower.jl
I remember from profiling a while ago that the power function was the main bottleneck for the kinematic wave. So I wonder how much difference this trade of precision for performance will be. This function by itself is about 2-2.5x faster.

@visr
Copy link
Member Author

visr commented Oct 1, 2024

Wow I'm surprised, but this actually leads to significantly worse performance. It looks like with the lower power precision the kinematic wave doesn't convergence well. The epsilon of 1e-12 may just be too low, making it hit the max_iters instead.

function kinematic_wave(Qin, Qold, q, alpha, beta, dt, dx)
epsilon = 1.0e-12
max_iters = 3000

If I set the epsilon higher, the performance difference goes down.

@visr visr marked this pull request as draft October 1, 2024 20:02
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.

1 participant