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

adding type specs to jitted functions? #139

Open
amoodie opened this issue Feb 15, 2021 · 0 comments
Open

adding type specs to jitted functions? #139

amoodie opened this issue Feb 15, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@amoodie
Copy link
Member

amoodie commented Feb 15, 2021

Above the _get_water_weight_array() function there's commented out code specifying the expected input types in the @njit decorator.

As far as I understand it, adding the types does not speed up the actual computations, but it does speed up the actual just-in-time compilation. So instead of the first timestep taking 30 seconds, and then the next ones taking 1 second, the first could be reduced to ~5 seconds if the types are specified.

This is nice, but it is definitely a confusing and intimidating block of code for someone new to python/numba who may want to implement their own methods/functions or modify our own. I think it's something to consider, and with the appropriate documentation, may be worthwhile.

@amoodie amoodie added the enhancement New feature or request label Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant