if u are working with large data its a thread/process pool excuter with a map if its not parlalizble then save it to memory/push to db inside a for loop if its something like an np array or pytorch tensor try and use the package build in operations the rest is allways comprehention except if u r working with non python people
I'm new to programming and using generators with database in case the data comes one day to be large. my question is isn't it always good to go with does the performance matter as big YES like why we even need to consider another approach?
Haha, fair point! Absolutely, it's all about context. While list comprehension in Python can offer great readability and convenience, performance considerations may lead some to explore languages like C++. It's a trade-off between ease of development and raw speed. Although if you go with python you wouldn't want your code freezing unexpectedly!
If performance is important, I'd go with numpy.
if u are working with large data its a thread/process pool excuter with a map
if its not parlalizble then save it to memory/push to db inside a for loop
if its something like an np array or pytorch tensor try and use the package build in operations
the rest is allways comprehention except if u r working with non python people
well well, that was helpful.
I'm new to programming and using generators with database in case the data comes one day to be large. my question is isn't it always good to go with does the performance matter as big YES like why we even need to consider another approach?
The "Is performance important" diamond should be further up the tree, where the other branch is C++, but now I'm just being rude.
Haha, fair point! Absolutely, it's all about context. While list comprehension in Python can offer great readability and convenience, performance considerations may lead some to explore languages like C++. It's a trade-off between ease of development and raw speed. Although if you go with python you wouldn't want your code freezing unexpectedly!
ya if u need preformance in raw python stuff went horibly wrong.
we have c# java go for a reason...
There is Libraries in C++ to create module for python too if you need more speed for a particular task it can be quiet useful
Welcome back 🎉