Skip to content
Discussion options

You must be logged in to vote

Thanks for the question! I don't think this is well-covered in the tutorials, but from the user perspective there is essentially no difference between your approach 1 and approach 2: everything that is computed within a jitted function is JIT-compiled; if parts of that happen to be separately jitted, it makes no difference.

One comment, though: JIT compilation will unroll Python loops, which means that as written there will be 1000 copies of your operations serialized and passed to the compiler in both approaches, so either one will likely lead to very slow compilation times. One way to work around this is through Structured control flow operations.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JiahaoYao
Comment options

Answer selected by JiahaoYao
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants