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

Add "schedule" annotation to NIF functions #148

Merged

Conversation

philss
Copy link
Member

@philss philss commented Mar 31, 2022

This is needed to classify most of the NIF functions as
possible "dirty".
For smaller sets, those functions should not take more
than 1 millisecond to perform. But for larger datasets,
it's probably going to take more time.

This follows the recommendations from:
https://www.erlang.org/doc/man/erl_nif.html#lengthy_work

Also see rusterlium/rustler#402

This is needed to classify most of the NIF functions as
possible "dirty".
For smaller sets, those functions should not take more
than 1 millisecond to perform. But for larger datasets,
it's probably going to take more time.

This follows the recommendations from:
https://www.erlang.org/doc/man/erl_nif.html#lengthy_work

Also see rusterlium/rustler#402
Copy link
Member

@cigrainger cigrainger left a comment

Choose a reason for hiding this comment

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

I've been wondering about this and hadn't seen any problems so have been putting it off. Thanks for doing this!

@cigrainger cigrainger merged commit 746b648 into elixir-explorer:main Mar 31, 2022
@josevalim
Copy link
Member

@cigrainger btw, once the backend becomes lazy, you only need those annotations in the functions that do IO operations and the ones that compute. The regular functions do not need to be tagged. :)

@philss philss deleted the ps-add-dirty-schedule-annotations branch April 1, 2022 15:06
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.

3 participants