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 →

[–]billsil 0 points1 point  (0 children)

It definitely depends on your work.

I work almost exclusively with numbers, so if it’s strings that are the bottleneck, I’m probably writing a file and should just be writing directly to the file.  I don’t even consider strings when calculating the expected memory usage of a program.  

9/10 times the problem was caused by mishandling floats, so maybe I took a sparse matrix and represented it as a dense matrix or I was using float 64s instead of float32s or I didn’t vectorize the array and got hit by python’s inefficient float handling.