Skip to content

Reduce initial costs #2157

Answered by agoose77
Durman asked this question in Q&A
Jan 25, 2023 · 2 comments · 6 replies
Discussion options

You must be logged in to vote

We don't yet have a section on this in our docs, but I'll get round to that at some point!

The best solution for your needs (low overhead) is probably Numba. The trade-off of using Numba is primarily expressiveness; some things are more cumbersome or sometimes impossible to write. However, in this case, it should be fairly straightforward. Here's a function doing what I think you're hoping to achieve; to subdivide a set of poly-lines N times:

This function evaluates much, much faster than the pure Awkward variant (because the data are so small), which is beneficial for your use case. I get 0.02 seconds per thousand iterations, which compares with 8 seconds per thousand for the pure-awkwar…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@agoose77
Comment options

@Durman
Comment options

@agoose77
Comment options

@jpivarski
Comment options

@Durman
Comment options

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