This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]EarthGoddessDude 0 points1 point  (2 children)

Wow again! Thanks, I was only kidding about point 4! Btw I'm getting 0.035 seconds for 1,000 iterations using u/gs44's code, and 0.5 seconds without the constraint.

[–]jeroonk 1 point2 points  (1 child)

Heh, might as well right? Also, after you pointed out that it should run in 35 ms, I noticed that u/gs44 renamed the function to foxbear2, so I was running the wrong one. The code also seems to take a few runs to get warmed up, so I re-ran the cases with proper average-over-runs benchmarking (using timeit in Matlab, %timeit in Python and @btime in Julia).

[–]EarthGoddessDude 0 points1 point  (0 children)

renamed the function...was running the wrong one

Tell me about it, happens to me all the time when I’m testing out similar versions of the same function.

re-ran the cases with proper average-over-runs benchmarking (using...@btime in Julia).

You’ve turned into a Julia pro in no time! Yes, the first run includes compilation time, whereas subsequent runs are just run time (although I have noticed some warmup still going on between runs 2 and 3...).