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

Consider adding a warning about lengthy work #402

Open
dlesl opened this issue Nov 7, 2021 · 2 comments
Open

Consider adding a warning about lengthy work #402

dlesl opened this issue Nov 7, 2021 · 2 comments

Comments

@dlesl
Copy link
Contributor

dlesl commented Nov 7, 2021

Rustler is quite mature now and thanks to its great documentation it's easy to get a project working without reading the official erl_nif docs, which unfortunately means that users might not be aware of the big warning box there. While rustler can help eliminate memory errors, the warning about lengthy work is still just as valid, and for many projects, finding a way to do lengthy work correctly will end up being the most challenging part of writing a NIF. I think it would be helpful to:

@dlesl
Copy link
Contributor Author

dlesl commented Nov 7, 2021

enif_consume_timeslice would be good to mention too

@scrogson
Copy link
Member

scrogson commented Nov 9, 2021

Agreed.

philss added a commit to philss/explorer that referenced this issue 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
cigrainger pushed a commit to elixir-explorer/explorer that referenced this issue 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
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

2 participants