Skip to content
Discussion options

You must be logged in to vote

Outside JIT, insertion operations like x = x.at[y].set(z) result in a copy of the full buffer. So it makes sense that (1) it would be slower than numpy's in-place insertions, and (2) it would be slower for larger buffers than for smaller buffers.

Inside JIT, XLA is able to avoid these copies by essentially compiling them into in-place operations.

So I'd suggest JIT-compiling your function to improve the performance.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@yardenas
Comment options

@jakevdp
Comment options

@yardenas
Comment options

Answer selected by yardenas
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