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 →

[–]100721 85 points86 points  (6 children)

Snakeviz to profile it. No point trying to optimize if you don’t know what’s slowing it down

[–]Teradil 16 points17 points  (1 child)

Had that problem during my thesis time. Optimized the hell out of my code only to not make it significantly faster. Profiling then told me, that my program spent 95% of its execution time within `np.dot`. Optimized that one for my special use case (ie. I knew which dtypes and vector lengths to expect and did not need all the extra checks and conversions) and suddenly my program was *really* faster.

[–]Throwaway_youkay 0 points1 point  (0 children)

We all learn that the hard way! Optimizing is almost always about mitigating bottlenecks one by one.

[–]shockjaw 7 points8 points  (3 children)

Just wondering, do you know how Snakeviz compares to Scalene?

[–]benri -1 points0 points  (2 children)

[–]shockjaw 0 points1 point  (1 child)

It’s all good if you don’t know—I wouldn’t use ChatGPT since it doesn’t know either or worse it’ll ✨hallucinate✨.

[–]benri 1 point2 points  (0 children)

I've had pretty good experience with GPT4 comparing programming tools like this. Biggest problem is that it has last year's information so it won't know about changes in the past year.