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

Avoid keyword args to njit functions #643

Open
tornikeo opened this issue May 13, 2024 · 0 comments
Open

Avoid keyword args to njit functions #643

tornikeo opened this issue May 13, 2024 · 0 comments

Comments

@tornikeo
Copy link
Contributor

tornikeo commented May 13, 2024

Describe the bug
For some odd reason, adding default values to keyword args to @njit-decorated functions results in 20x slowdowns in frequently used functions, like collect_peak_pairs. Further optimizations can bring this particular function to 40x speedup.

To Reproduce
Steps to reproduce the behavio:

It shows that original collect_peak_pairs takes around

63.5 µs ± 1.06 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

While optimized takes around:

1.52 µs ± 26.9 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)

What else?
Given that this function is the innermost segment in a double python for-loop, I don't know how much of a total runtime impact this will have - that outer loop has to be optimized too to take full advantage of this.

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

No branches or pull requests

1 participant